From 94207dfd68ca426d7cd4a8a0dc84e5a955d3a6d9 Mon Sep 17 00:00:00 2001 From: Heinz Mauelshagen Date: Mon, 18 Jul 2016 20:16:40 +0200 Subject: [PATCH] lvconvert: raid0 replace attempt segfaults Any failing stripes in raid0/raid0_meta type LVs cause data loss, thus replacement via 'lvconvert --replace...' does not make sense. Patch prohibits replacement on raid0/raid0_meta LVs. - resolves rhbz1356734 --- lib/metadata/raid_manip.c | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/lib/metadata/raid_manip.c b/lib/metadata/raid_manip.c index feb8d6e59..2dbbbe49b 100644 --- a/lib/metadata/raid_manip.c +++ b/lib/metadata/raid_manip.c @@ -2829,6 +2829,12 @@ int lv_raid_replace(struct logical_volume *lv, struct lv_list *lvl; char *tmp_names[raid_seg->area_count * 2]; + if (seg_is_any_raid0(raid_seg)) { + log_error("Can't replace any devices in %s LV %s", + lvseg_name(raid_seg), display_lvname(lv)); + return 0; + } + dm_list_init(&old_lvs); dm_list_init(&new_meta_lvs); dm_list_init(&new_data_lvs); -- 2.43.5