diff options
Diffstat (limited to 'daemons/clvmd')
-rw-r--r-- | daemons/clvmd/lvm-functions.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/daemons/clvmd/lvm-functions.c b/daemons/clvmd/lvm-functions.c index 9f11d22a..6c2fbfe3 100644 --- a/daemons/clvmd/lvm-functions.c +++ b/daemons/clvmd/lvm-functions.c @@ -430,6 +430,7 @@ static int do_suspend_lv(char *resource, unsigned char command, unsigned char lo int oldmode; struct lvinfo lvi; unsigned origin_only = (lock_flags & LCK_ORIGIN_ONLY_MODE) ? 1 : 0; + unsigned exclusive; /* Is it open ? */ oldmode = get_current_lock(resource); @@ -438,11 +439,14 @@ static int do_suspend_lv(char *resource, unsigned char command, unsigned char lo return 0; /* Not active, so it's OK */ } + exclusive = (oldmode == LCK_EXCL) ? 1 : 0; + /* Only suspend it if it exists */ if (!lv_info_by_lvid(cmd, resource, origin_only, &lvi, 0, 0)) return EIO; - if (lvi.exists && !lv_suspend_if_active(cmd, resource, origin_only)) + if (lvi.exists && + !lv_suspend_if_active(cmd, resource, origin_only, exclusive)) return EIO; return 0; |