From: Heinz Mauelshagen Date: Mon, 18 Jul 2016 18:16:40 +0000 (+0200) Subject: lvconvert: raid0 replace attempt segfaults X-Git-Tag: v2_02_162~46 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=94207dfd68ca426d7cd4a8a0dc84e5a955d3a6d9;p=lvm2.git 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 --- 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);