]> sourceware.org Git - lvm2.git/commitdiff
Disallow changing cluster attribute of VG while RAID LVs are active.
authorJonathan Earl Brassow <jbrassow@redhat.com>
Wed, 25 Apr 2012 13:38:41 +0000 (13:38 +0000)
committerJonathan Earl Brassow <jbrassow@redhat.com>
Wed, 25 Apr 2012 13:38:41 +0000 (13:38 +0000)
Mirror and snapshot LVs are already checked for when switching the cluster
attribute of a VG.  This patch adds RAID.

WHATS_NEW
lib/metadata/vg.c

index d5452e089fc3965a209151b3bf753b827cd47cf1..f50780f276daf71a931bf47a746c1ca4cb95b7ff 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.96 - 
 ================================
+  Disallow changing cluster attribute of VG while RAID LVs are active.
   Fix lvconvert error message for non-mergeable volumes.
   Allow subset of failed devices to be replaced in RAID LVs.
   Prevent resume from creating error devices that already exist from suspend.
index bae22dc8f4e93f508c2097ac20c66d06296db5bc..29e9aa4a69806b375958401214fd469254cded28 100644 (file)
@@ -517,9 +517,11 @@ int vg_set_clustered(struct volume_group *vg, int clustered)
         * on active mirrors or snapshots.
         */
        dm_list_iterate_items(lvl, &vg->lvs) {
-               if (lv_is_mirrored(lvl->lv) && lv_is_active(lvl->lv)) {
-                       log_error("Mirror logical volumes must be inactive "
-                                 "when changing the cluster attribute.");
+               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 "
+                                 "when changing the cluster attribute.",
+                                 lv_is_raid_type(lvl->lv) ? "RAID" : "Mirror");
                        return 0;
                }
 
This page took 0.034368 seconds and 5 git commands to generate.