Commit 9b7e05a6 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

cmdlib.LUInstanceRename: Another assertion for BGL

Check whether the BGL is actually held instead of just testing
Signed-off-by: default avatarMichael Hanselmann <>
Reviewed-by: default avatarHelga Velroyen <>
parent 4a4c0092
......@@ -7620,6 +7620,7 @@ class LUInstanceRename(LogicalUnit):
# Change the instance lock. This is definitely safe while we hold the BGL.
# Otherwise the new lock would have to be added in acquired mode.
assert self.REQ_BGL
assert self.glm.is_owned(locking.BGL)
self.glm.remove(locking.LEVEL_INSTANCE, old_name)
self.glm.add(locking.LEVEL_INSTANCE, self.op.new_name)
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