summaryrefslogtreecommitdiffstats
path: root/lib/activate
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 /lib/activate
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 'lib/activate')
-rw-r--r--lib/activate/activate.c7
-rw-r--r--lib/activate/activate.h2
2 files changed, 6 insertions, 3 deletions
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index be235b17..e33d4694 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -1455,9 +1455,12 @@ out:
}
/* Returns success if the device is not active */
-int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only)
+int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only, unsigned exclusive)
{
- struct lv_activate_opts laopts = { .origin_only = origin_only };
+ struct lv_activate_opts laopts = {
+ .origin_only = origin_only,
+ .exclusive = exclusive
+ };
return _lv_suspend(cmd, lvid_s, &laopts, 0);
}
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index 92587620..d053eefd 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -64,7 +64,7 @@ void activation_release(void);
void activation_exit(void);
/* int lv_suspend(struct cmd_context *cmd, const char *lvid_s); */
-int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only);
+int lv_suspend_if_active(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only, unsigned exclusive);
int lv_resume(struct cmd_context *cmd, const char *lvid_s, unsigned origin_only);
int lv_resume_if_active(struct cmd_context *cmd, const char *lvid_s,
unsigned origin_only, unsigned exclusive, unsigned revert);