summaryrefslogtreecommitdiffstats
path: root/lib/activate
diff options
context:
space:
mode:
authorJonathan Earl Brassow <jbrassow@redhat.com>2011-06-22 21:31:21 +0000
committerJonathan Earl Brassow <jbrassow@redhat.com>2011-06-22 21:31:21 +0000
commit9e277b9e2ccc40ec645bfdafaf26891bf6c59ce7 (patch)
tree88a8289ba9602649c90584bfd0ee50d6a2d419cf /lib/activate
parent901e7257d11471573301112c85c3a4d013b61f84 (diff)
downloadlvm2-9e277b9e2ccc40ec645bfdafaf26891bf6c59ce7.tar.gz
lvm2-9e277b9e2ccc40ec645bfdafaf26891bf6c59ce7.tar.xz
lvm2-9e277b9e2ccc40ec645bfdafaf26891bf6c59ce7.zip
Fix issue preventing cluster mirror creation.
Mirrors used to be created by first creating a linear device and then adding the other images plus the log. Now mirrors are created by creating all the images in one go and then adding the log separately. The new way ran into the condition that cluster mirrors cannot change the log type (in the case of creation, from core -> disk) while the mirror is not active. (It isn't active because it is in the process of being created.) The reason this condition is in place is because a remote node may have the mirror active, and we don't want to alter the log underneath it. What we really needed was a way of checking if the mirror was active remotely but not locally, and in that case do not allow a change of the log. I've added this check, and cluster mirrors can now be created again.
Diffstat (limited to 'lib/activate')
-rw-r--r--lib/activate/activate.c6
-rw-r--r--lib/activate/activate.h1
2 files changed, 3 insertions, 4 deletions
diff --git a/lib/activate/activate.c b/lib/activate/activate.c
index f6d157ae..2f922940 100644
--- a/lib/activate/activate.c
+++ b/lib/activate/activate.c
@@ -823,13 +823,11 @@ int lv_is_active(struct logical_volume *lv)
return _lv_is_active(lv, NULL, NULL);
}
-/*
-int lv_is_active_locally(struct logical_volume *lv)
+int lv_is_active_but_not_locally(struct logical_volume *lv)
{
int l;
- return _lv_is_active(lv, &l, NULL) && l;
+ return _lv_is_active(lv, &l, NULL) && !l;
}
-*/
int lv_is_active_exclusive_locally(struct logical_volume *lv)
{
diff --git a/lib/activate/activate.h b/lib/activate/activate.h
index 022b7973..f253c127 100644
--- a/lib/activate/activate.h
+++ b/lib/activate/activate.h
@@ -101,6 +101,7 @@ int lvs_in_vg_activated(struct volume_group *vg);
int lvs_in_vg_opened(const struct volume_group *vg);
int lv_is_active(struct logical_volume *lv);
+int lv_is_active_but_not_locally(struct logical_volume *lv);
int lv_is_active_exclusive_locally(struct logical_volume *lv);
int lv_is_active_exclusive_remotely(struct logical_volume *lv);