Commit 60db9336 authored by Michael Hanselmann's avatar Michael Hanselmann
Browse files

LUGetTags: Acquire locks in shared mode



Retrieving tags can be done while the lock is shared. Only writing
needs to be exclusive.

Also add a FIXME for cluster tags, where the code currently doesn't
use any locks except the config lock.
Signed-off-by: default avatarMichael Hanselmann <hansmi@google.com>
Reviewed-by: default avatarIustin Pop <iustin@google.com>
parent f1b083ce
......@@ -9786,6 +9786,9 @@ class TagsLU(NoHooksLU): # pylint: disable-msg=W0223
self.op.name = _ExpandInstanceName(self.cfg, self.op.name)
self.needed_locks[locking.LEVEL_INSTANCE] = self.op.name
# FIXME: Acquire BGL for cluster tag operations (as of this writing it's
# not possible to acquire the BGL based on opcode parameters)
def CheckPrereq(self):
"""Check prerequisites.
......@@ -9812,6 +9815,12 @@ class LUGetTags(TagsLU):
]
REQ_BGL = False
def ExpandNames(self):
TagsLU.ExpandNames(self)
# Share locks as this is only a read operation
self.share_locks = dict.fromkeys(locking.LEVELS, 1)
def Exec(self, feedback_fn):
"""Returns the tag list.
......
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