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