]> sourceware.org Git - lvm2.git/commitdiff
vgsplit: ea90a3d622 added an unconditional call to lv_is_on_pvs()
authorHeinz Mauelshagen <heinzm@redhat.com>
Thu, 28 Jul 2016 16:34:46 +0000 (18:34 +0200)
committerHeinz Mauelshagen <heinzm@redhat.com>
Thu, 28 Jul 2016 16:35:33 +0000 (18:35 +0200)
         on any thin snap external origin LV which caused a segfault
         when none existed as exposed by the vgsplit-thin.sh test.

         Only call lv_is_on_pvs() if an external origin LV actually
         exists and correct the related splitting logic.

tools/vgsplit.c

index fd43650afd5e1bc54c398a8c2a95eadf18db22a8..93161c17d5ae8ace2faeda4e40c99b339526e895 100644 (file)
@@ -331,8 +331,8 @@ static int _move_thins(struct volume_group *vg_from,
                        data_lv = seg_lv(first_seg(seg->pool_lv), 0);
 
                        /* Ignore, if no allocations on PVs of @vg_to */
-                       if (!lv_is_on_pvs(data_lv, &vg_to->pvs) &&
-                           !lv_is_on_pvs(seg->external_lv, &vg_to->pvs))
+                       if (!lv_is_on_pvs(data_lv, &vg_to->pvs) ||
+                           (seg->external_lv && !lv_is_on_pvs(seg->external_lv, &vg_to->pvs)))
                                continue;
 
                        if ((_lv_is_in_vg(vg_to, data_lv) ||
This page took 0.082521 seconds and 5 git commands to generate.