summaryrefslogtreecommitdiffstats
path: root/daemons/clvmd/lvm-functions.c
diff options
context:
space:
mode:
authorMilan Broz <mbroz@redhat.com>2009-12-09 18:45:12 +0000
committerMilan Broz <mbroz@redhat.com>2009-12-09 18:45:12 +0000
commit4499aa2ea5be39b1a10efa517183e3d374764931 (patch)
treefd3dbf4355d26f185d5b3888aa823dfd0d2fc58d /daemons/clvmd/lvm-functions.c
parentcc31b2bd3f16a6a4ef36421569ab178937603ace (diff)
downloadlvm2-4499aa2ea5be39b1a10efa517183e3d374764931.tar.gz
lvm2-4499aa2ea5be39b1a10efa517183e3d374764931.tar.xz
lvm2-4499aa2ea5be39b1a10efa517183e3d374764931.zip
Allow implicit "convert" to the same lock mode.
(Code already not fail if unlocking not locked resource.) This is needed in pre/post lock_lv call, where we can request the same lock on local node becuase of suspend call.
Diffstat (limited to 'daemons/clvmd/lvm-functions.c')
-rw-r--r--daemons/clvmd/lvm-functions.c5
1 files changed, 5 insertions, 0 deletions
diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c
index 7fee65d7..cf826991 100644
--- a/daemons/clvmd/lvm-functions.c
+++ b/daemons/clvmd/lvm-functions.c
@@ -245,6 +245,11 @@ int hold_lock(char *resource, int mode, int flags)
lvi = lookup_info(resource);
+ if (lvi && lvi->lock_mode == mode) {
+ DEBUGLOG("hold_lock, lock mode %d already held\n", mode);
+ return 0;
+ }
+
/* Only allow explicit conversions */
if (lvi && !(flags & LKF_CONVERT)) {
errno = EBUSY;