From 7072ed86f9d61e1a0553411a5c0d57d330a096e8 Mon Sep 17 00:00:00 2001 From: Jonathan Earl Brassow Date: Wed, 25 Apr 2012 13:38:41 +0000 Subject: [PATCH] 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. --- WHATS_NEW | 1 + lib/metadata/vg.c | 8 +++++--- 2 files changed, 6 insertions(+), 3 deletions(-) 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; }