diff options
author | Heinz Mauelshagen <heinzm@redhat.com> | 2016-07-28 18:34:46 +0200 |
---|---|---|
committer | Heinz Mauelshagen <heinzm@redhat.com> | 2016-07-28 18:35:33 +0200 |
commit | a579ba2ac27d9651165e7e997a5ff855dc83c170 (patch) | |
tree | 3028fa244ff5f6cdb70cfac3edad2ec23d18a841 | |
parent | 4bc351d65879f319cf94cc59ff781ca3d649060f (diff) | |
download | lvm2-a579ba2ac27d9651165e7e997a5ff855dc83c170.tar.gz |
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.
-rw-r--r-- | tools/vgsplit.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/tools/vgsplit.c b/tools/vgsplit.c index fd43650af..93161c17d 100644 --- a/tools/vgsplit.c +++ b/tools/vgsplit.c @@ -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) || |