Am 15. November 2011 10:33 schrieb Iustin Pop <ius...@google.com>: > On Tue, Nov 15, 2011 at 08:00:23AM +0100, Michael Hanselmann wrote: >> + # Since modifying a node can have severe effects on currently running >> + # operations the resource lock is at least acquired in shared mode >> + self.needed_locks[locking.LEVEL_NODE_RES] = \ >> + self.needed_locks[locking.LEVEL_NODE] >> + >> + # Get node and instance locks in shared mode; they are not used for >> + # anything but read-only access >> + self.share_locks[locking.LEVEL_NODE_RES] = 1 > > Comment says node, but lock is node res? > >> + self.share_locks[locking.LEVEL_INSTANCE] = 1 > > Can't see from the context, but the node lock is still in exclusive, > right? > > So maybe it's just comment typo…
It is, sorry. The first comment was right: the resource lock can be shared. --- a/lib/cmdlib.py +++ b/lib/cmdlib.py @@ -5312,12 +5312,12 @@ class LUNodeSetParams(LogicalUnit): # Since modifying a node can have severe effects on currently running # operations the resource lock is at least acquired in shared mode self.needed_locks[locking.LEVEL_NODE_RES] = \ self.needed_locks[locking.LEVEL_NODE] - # Get node and instance locks in shared mode; they are not used for - # anything but read-only access + # Get node resource and instance locks in shared mode; they are not used + # for anything but read-only access self.share_locks[locking.LEVEL_NODE_RES] = 1 self.share_locks[locking.LEVEL_INSTANCE] = 1 if self.lock_instances: self.needed_locks[locking.LEVEL_INSTANCE] = \ Michael