diff options
author | Milan Broz <mbroz@redhat.com> | 2009-12-09 18:45:12 +0000 |
---|---|---|
committer | Milan Broz <mbroz@redhat.com> | 2009-12-09 18:45:12 +0000 |
commit | 4499aa2ea5be39b1a10efa517183e3d374764931 (patch) | |
tree | fd3dbf4355d26f185d5b3888aa823dfd0d2fc58d /daemons/clvmd/lvm-functions.c | |
parent | cc31b2bd3f16a6a4ef36421569ab178937603ace (diff) | |
download | lvm2-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.c | 5 |
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; |