From: Jonathan Earl Brassow Date: Wed, 25 Apr 2012 13:38:41 +0000 (+0000) Subject: Disallow changing cluster attribute of VG while RAID LVs are active. X-Git-Tag: v2_02_96~51 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=ac6e1e3e8d25c7bfd4c861e9fc1961e9601bc9c4;p=lvm2.git Disallow changing cluster attribute of VG while RAID LVs are active. Mirror and snapshot LVs are already checked for when switching the cluster attribute of a VG. This patch adds RAID. --- diff --git a/WHATS_NEW b/WHATS_NEW index d5452e089..f50780f27 100644 --- 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. diff --git a/lib/metadata/vg.c b/lib/metadata/vg.c index bae22dc8f..29e9aa4a6 100644 --- a/lib/metadata/vg.c +++ b/lib/metadata/vg.c @@ -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; }