summaryrefslogtreecommitdiff
path: root/lib
diff options
context:
space:
mode:
authorDavid Teigland <teigland@redhat.com>2023-04-10 11:41:28 -0500
committerDavid Teigland <teigland@redhat.com>2023-04-10 12:44:22 -0500
commit317071ec53c2f6e338c53a8964fdbb61dc3e8b57 (patch)
tree33dc1dcf05bf1c8425727a46263b2b66b98b00ea /lib
parent8458ff9ad18c518b774d16358e28a805057e4dc1 (diff)
downloadlvm2-317071ec53c2f6e338c53a8964fdbb61dc3e8b57.tar.gz
cache: fix snapshot of cache with cachevol
Creating a snapshot of a cache LV with a cachevol would fail because cache_check was not being skipped.
Diffstat (limited to 'lib')
-rw-r--r--lib/activate/dev_manager.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/lib/activate/dev_manager.c b/lib/activate/dev_manager.c
index ec642f421..07d58733e 100644
--- a/lib/activate/dev_manager.c
+++ b/lib/activate/dev_manager.c
@@ -3694,6 +3694,8 @@ static int _add_new_lv_to_dtree(struct dev_manager *dm, struct dm_tree *dtree,
if (lv_is_cache(lv) && lv_is_cache_vol(first_seg(lv)->pool_lv) &&
/* Register callback only for layer activation or non-layered cache LV */
(layer || !lv_layer(lv)) &&
+ /* Register callback when cachevol LV is NOT already active */
+ !_cached_dm_info(dm->mem, dtree, first_seg(lv)->pool_lv, NULL) &&
!_pool_register_callback(dm, dnode, lv))
return_0;