From 0c1d3db8dbe45df9f4311f5c19014680ecf26613 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 23 May 2018 13:16:48 -0500 Subject: [PATCH] lvmlockd: accept repeated global lock requests It's not an error if a command requests the global lock when it has already acquired it. It shouldn't happen, but there could be cases we've not found. --- lib/locking/lvmlockd.c | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c index d78b35c88..bf9b7a946 100644 --- a/lib/locking/lvmlockd.c +++ b/lib/locking/lvmlockd.c @@ -1547,6 +1547,16 @@ int lockd_gl(struct cmd_context *cmd, const char *def_mode, uint32_t flags) } } + if (result == -EALREADY) { + /* + * This should generally not happen because commands should be coded + * to avoid reacquiring the global lock. If there is a case that's + * missed which causes the command to request the gl when it's already + * held, it's not a problem, so let it go. + */ + log_debug("lockd global mode %s already held.", mode); + return 1; + } if (!strcmp(mode, "un")) return 1;