From: Alasdair G Kergon Date: Wed, 28 Aug 2013 21:56:23 +0000 (+0100) Subject: activation: Fix segfault with inactive pvmove LV. X-Git-Tag: v2_02_101~67 X-Git-Url: https://sourceware.org/git/?a=commitdiff_plain;h=c0f987949b8a0bbbbe7f06694f59f710a73814da;p=lvm2.git activation: Fix segfault with inactive pvmove LV. Set flag to avoid recursion back through an inactive pvmove LV when populating deptree. --- diff --git a/WHATS_NEW b/WHATS_NEW index d974b0ae8..71e9fa8eb 100644 --- a/WHATS_NEW +++ b/WHATS_NEW @@ -1,6 +1,7 @@ Version 2.02.101 - =================================== - Require exactly 3 arguments for lvm2-activation-generator, remove defaults. + Avoid unlimited recursion when creating dtree containing inactive pvmove LV. + Require exactly 3 arguments for lvm2-activation-generator. Remove defaults. Disable pvmove of merging or converting logical volumes. Enable pvmove of snapshots and snapshot origins. Fix inability to specify LV name when pvmove'ing a RAID, mirror, or thin-LV. diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index 294606cc9..11be42166 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -1763,11 +1763,13 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, return_0; /* Add any LVs referencing a PVMOVE LV unless told not to. */ - if (dm->track_pvmove_deps && lv->status & PVMOVE) + if (dm->track_pvmove_deps && lv->status & PVMOVE) { + dm->track_pvmove_deps = 0; dm_list_iterate_items(sl, &lv->segs_using_this_lv) - if (!_cached_info(dm->mem, dtree, sl->seg->lv, 0) && - !_add_lv_to_dtree(dm, dtree, sl->seg->lv, origin_only)) + if (!_add_lv_to_dtree(dm, dtree, sl->seg->lv, origin_only)) return_0; + dm->track_pvmove_deps = 1; + } /* Adding LV head of replicator adds all other related devs */ if (lv_is_replicator_dev(lv) &&