[lvm-devel] master - lockd: add error message for EEXIST

David Teigland teigland at fedoraproject.org
Fri Oct 2 20:43:20 UTC 2015


Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=df59db6048a6be79acf231b98fd560b11cce7c7c
Commit:        df59db6048a6be79acf231b98fd560b11cce7c7c
Parent:        b33d7586e7f629818e881e26677f4431a47d50b5
Author:        David Teigland <teigland at redhat.com>
AuthorDate:    Fri Oct 2 15:41:23 2015 -0500
Committer:     David Teigland <teigland at redhat.com>
CommitterDate: Fri Oct 2 15:41:23 2015 -0500

lockd: add error message for EEXIST

The EEXIST error for LV locks is unusual, and
was missing an explanatory error message.
---
 lib/locking/lvmlockd.c |    9 +++++++++
 1 files changed, 9 insertions(+), 0 deletions(-)

diff --git a/lib/locking/lvmlockd.c b/lib/locking/lvmlockd.c
index afbafcb..f741940 100644
--- a/lib/locking/lvmlockd.c
+++ b/lib/locking/lvmlockd.c
@@ -2010,6 +2010,15 @@ int lockd_lv_name(struct cmd_context *cmd, struct volume_group *vg,
 		return 0;
 	}
 
+	if (result == -EEXIST) {
+		/*
+		 * This happens if lvchange tries to modify the LV with an ex
+		 * LV lock when the LV is already active with a sh LV lock.
+		 */
+		log_error("LV is already locked with incompatible mode: %s/%s", vg->name, lv_name);
+		return 0;
+	}
+
 	if (result == -EMSGSIZE) {
 		/* Another host probably extended lvmlock. */
 		if (!refreshed++) {




More information about the lvm-devel mailing list