From b47b66ebff36adf8031cb13178f44daede674839 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 21 Mar 2024 21:02:24 +0100 Subject: [PATCH] dev_manager: pending traces only existing LV Before adding LV to the dtree, check whether it's already in dtree. --- lib/activate/dev_manager.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c index e15291371..0795a941f 100644 --- a/lib/activate/dev_manager.c +++ b/lib/activate/dev_manager.c @@ -2886,7 +2886,8 @@ static int _add_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree, if (lv_is_pending_delete(sl->seg->lv)) { /* LV is referenced by 'cache pending delete LV */ dm->track_pending_delete = 1; - if (!_add_lv_to_dtree(dm, dtree, sl->seg->lv, origin_only)) + if (!_cached_dm_tree_node(dm->mem, dtree, sl->seg->lv, lv_layer(sl->seg->lv)) && + !_add_lv_to_dtree(dm, dtree, sl->seg->lv, 0)) return_0; dm->track_pending_delete = 0; }