mrc0mmand / rpms / lvm2

Forked from rpms/lvm2 2 years ago
Clone

Blame SOURCES/lvm2-2_02_187-raid-disallow-reshape-of-stacked-LVs.patch

b83e05
 WHATS_NEW                 | 1 +
b83e05
 lib/metadata/raid_manip.c | 6 ++++++
b83e05
 2 files changed, 7 insertions(+)
b83e05
b83e05
diff --git a/WHATS_NEW b/WHATS_NEW
b83e05
index ac70074..01d0bc6 100644
b83e05
--- a/WHATS_NEW
b83e05
+++ b/WHATS_NEW
b83e05
@@ -1,5 +1,6 @@
b83e05
 Version 2.02.187 - 
b83e05
 ===================================
b83e05
+  Prevent raid reshaping of stacked volumes.
b83e05
   Fix lvmetad shutdown and avoid lenghty timeouts when rebooting system.
b83e05
   Prevent creating VGs with PVs with different logical block sizes.
b83e05
   Pvmove runs in exlusively activating mode for exclusively active LVs.
b83e05
diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c
b83e05
index bffae60..768f261 100644
b83e05
--- a/lib/metadata/raid_manip.c
b83e05
+++ b/lib/metadata/raid_manip.c
b83e05
@@ -6445,6 +6445,12 @@ int lv_raid_convert(struct logical_volume *lv,
b83e05
 	uint32_t available_slvs, removed_slvs;
b83e05
 	takeover_fn_t takeover_fn;
b83e05
 
b83e05
+	/* FIXME Can't reshape volume in use - aka not toplevel devices */
b83e05
+	if (!dm_list_empty(&lv->segs_using_this_lv)) {
b83e05
+		log_error("Can't reshape stacked volume %s.", display_lvname(lv));
b83e05
+		return 0;
b83e05
+	}
b83e05
+
b83e05
 	/* FIXME If not active, prompt and activate */
b83e05
 	/* FIXME Some operations do not require the LV to be active */
b83e05
 	/* LV must be active to perform raid conversion operations */