[lvm-devel] master - locking: fix repeated convert to ex

David Teigland teigland at sourceware.org
Mon Jun 10 19:39:34 UTC 2019


Gitweb:        https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=b7850faba72a50e49783a3b01e6833fc1a99873b
Commit:        b7850faba72a50e49783a3b01e6833fc1a99873b
Parent:        49b884656725a39a33a5e27dd6377443e7e177e4
Author:        David Teigland <teigland at redhat.com>
AuthorDate:    Mon Jun 10 12:04:49 2019 -0500
Committer:     David Teigland <teigland at redhat.com>
CommitterDate: Mon Jun 10 13:37:03 2019 -0500

locking: fix repeated convert to ex

Some uncommon commands like pvchange -a -u may
call convert to ex multiple times.
---
 lib/locking/locking.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/lib/locking/locking.c b/lib/locking/locking.c
index c3ea536..3058a8b 100644
--- a/lib/locking/locking.c
+++ b/lib/locking/locking.c
@@ -384,6 +384,10 @@ int lockf_global(struct cmd_context *cmd, const char *mode)
 
 int lockf_global_convert(struct cmd_context *cmd, const char *mode)
 {
+	/* some uncommon cases like pvchange -a can call this multiple times */
+	if (cmd->lockf_global_ex && !strcmp(mode, "ex"))
+		return 1;
+
 	return _lockf_global(cmd, mode, 1);
 }
 




More information about the lvm-devel mailing list