locking: Change locking order, move NAL after instances
authorMichael Hanselmann <hansmi@google.com>
Thu, 29 Nov 2012 09:19:17 +0000 (10:19 +0100)
committerMichael Hanselmann <hansmi@google.com>
Thu, 29 Nov 2012 10:46:20 +0000 (11:46 +0100)
commit48aaca91efa214b37dba94f28582be73f3c90dbd
tree46f2f2c0505465c23b87a4bfe285722aebe353f5
parent4349c24d7975ea9c985d1b425da607db233c2f68
locking: Change locking order, move NAL after instances

Some opcodes, for example LUInstanceFailover and LUInstanceMigrate,
can't know whether they need to acquire all nodes until they have a lock
on the instance. In turn they would have to acquire the node allocation
lock “just in case” and could only release it once the instance had been
acquired.

Since there is no good reason for the node allocation lock to be before
instances in the locking order, this patch changes the order so that
instances are locked first.

Signed-off-by: Michael Hanselmann <hansmi@google.com>
Reviewed-by: Helga Velroyen <helgav@google.com>
lib/locking.py