Commit 4d4eae2a authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

Use resource lock when setting node parameters

Also acquire instance and resource locks in shared mode (see comment).
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarIustin Pop <>
parent 42828156
......@@ -5309,6 +5309,16 @@ class LUNodeSetParams(LogicalUnit):
self.needed_locks = {locking.LEVEL_NODE: self.op.node_name}
# 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] = \
# 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] = \
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment