summaryrefslogtreecommitdiffstats
path: root/daemons/clvmd
diff options
context:
space:
mode:
authorJonathan Earl Brassow <jbrassow@redhat.com>2012-01-20 00:27:18 +0000
committerJonathan Earl Brassow <jbrassow@redhat.com>2012-01-20 00:27:18 +0000
commit25d1410592aa4b928a8449038dab2eefab3d6e61 (patch)
tree71a45a07d8471cd4af283c30078f66c1b83f9f0d /daemons/clvmd
parent2f65269b77e3856591b7f83fa379044acdadbeab (diff)
downloadlvm2-25d1410592aa4b928a8449038dab2eefab3d6e61.tar.gz
lvm2-25d1410592aa4b928a8449038dab2eefab3d6e61.tar.xz
lvm2-25d1410592aa4b928a8449038dab2eefab3d6e61.zip
Preserve exclusive activation of cluster mirror when converting.
This patch to the suspend code - like the similar change for resume - queries the lock mode of a cluster volume and records whether it is active exclusively. This is necessary for suspend due to the possibility of preloading targets. Failure to check to exclusivity causes the cluster target of an exclusively activated mirror to be used when converting - rather than the single machine target.
Diffstat (limited to 'daemons/clvmd')
-rw-r--r--daemons/clvmd/lvm-functions.c6
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;