summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJonathan Brassow <jbrassow@redhat.com>2012-10-03 15:52:54 -0500
committerJonathan Brassow <jbrassow@redhat.com>2012-10-03 15:52:54 -0500
commit9efd3fb604ae34803bb2d4c94080c57d3efdba81 (patch)
tree842de35c17f2616e194714cdc1259927f5905b26
parenta27650cc983d54767316998e1df472325d169617 (diff)
downloadlvm2-9efd3fb604ae34803bb2d4c94080c57d3efdba81.tar.gz
lvm2-9efd3fb604ae34803bb2d4c94080c57d3efdba81.tar.xz
lvm2-9efd3fb604ae34803bb2d4c94080c57d3efdba81.zip
RAID: Do not allow RAID LVs in a cluster volume group.
It would be possible to activate a RAID LV exclusively in a cluster volume group, but for now we do not allow RAID LVs to exist in a clustered volume group at all. This has two components: 1) Do not allow RAID LVs to be created in a clustered VG 2) Do not allow changing a VG from single-machine to clustered if there are RAID LVs present.
-rw-r--r--WHATS_NEW1
-rw-r--r--lib/metadata/lv_manip.c19
-rw-r--r--lib/metadata/vg.c13
3 files changed, 30 insertions, 3 deletions
diff --git a/WHATS_NEW b/WHATS_NEW
index cd325b98..18e860c1 100644
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
Version 2.02.98 -
=================================
+ Do not allow RAID LVs in a clustered volume group.
Update lvconvert to support stacking of devs for thin meta/data devs.
Support changes of permissions for thin snapshot volumes.
Enhance insert_layer_for_lv() with recursive rename for _tdata LVs.
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c
index 4f86d148..d469fe85 100644
--- a/lib/metadata/lv_manip.c
+++ b/lib/metadata/lv_manip.c
@@ -4438,10 +4438,25 @@ static struct logical_volume *_lv_create_an_lv(struct volume_group *vg, struct l
if (!(lvl = find_lv_in_vg(vg, lp->pool))) {
log_error("Unable to find existing pool LV %s in VG %s.",
lp->pool, vg->name);
- return 0;
+ return NULL;
}
if (!update_pool_lv(lvl->lv, 1))
- return_0;
+ return_NULL;
+ }
+
+ if (vg_is_clustered(vg) && segtype_is_raid(lp->segtype)) {
+ /*
+ * FIXME:
+ * We could allow a RAID LV to be created as long as it
+ * is activated exclusively. Any subsequent activations
+ * would have to be enforced as exclusive also.
+ *
+ * For now, we disallow the existence of RAID LVs in a
+ * cluster VG
+ */
+ log_error("Unable to create a %s logical volume in a cluster.",
+ lp->segtype->name);
+ return NULL;
}
if (segtype_is_mirrored(lp->segtype) || segtype_is_raid(lp->segtype)) {
diff --git a/lib/metadata/vg.c b/lib/metadata/vg.c
index 29e9aa4a..2897d426 100644
--- a/lib/metadata/vg.c
+++ b/lib/metadata/vg.c
@@ -514,9 +514,20 @@ int vg_set_clustered(struct volume_group *vg, int clustered)
/*
* We do not currently support switching the cluster attribute
- * on active mirrors or snapshots.
+ * on active mirrors, snapshots or RAID logical volumes.
*/
dm_list_iterate_items(lvl, &vg->lvs) {
+ /*
+ * FIXME:
+ * We could allow exclusive activation of RAID LVs, but
+ * for now we disallow them in a cluster VG at all.
+ */
+ if (lv_is_raid_type(lvl->lv)) {
+ log_error("RAID logical volumes are not allowed "
+ "in a cluster volume group.");
+ return 0;
+ }
+
if (lv_is_active(lvl->lv) &&
(lv_is_mirrored(lvl->lv) || lv_is_raid_type(lvl->lv))) {
log_error("%s logical volumes must be inactive "