]> sourceware.org Git - lvm2.git/commitdiff
lvconvert: raid0 replace attempt segfaults
authorHeinz Mauelshagen <heinzm@redhat.com>
Mon, 18 Jul 2016 18:16:40 +0000 (20:16 +0200)
committerHeinz Mauelshagen <heinzm@redhat.com>
Mon, 18 Jul 2016 18:16:40 +0000 (20:16 +0200)
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

index feb8d6e59c7e1c904fef56c1632857ff99d4a1f6..2dbbbe49bdfa5759c223e7df6d2e5c252d0edf92 100644 (file)
@@ -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);
This page took 0.040374 seconds and 5 git commands to generate.