1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-30 17:18:21 +03:00

vgsplit: ea90a3d622 added an unconditional call to lv_is_on_pvs()

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.
This commit is contained in:
Heinz Mauelshagen 2016-07-28 18:34:46 +02:00
parent 4bc351d658
commit a579ba2ac2

View 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) ||