master - cache: recognize cachevol with lv_cache_remove
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=bc35ccd1740a588293b5a2eb5bbe936f837f6c21 Commit: bc35ccd1740a588293b5a2eb5bbe936f837f6c21 Parent: 36944e1009e932902269d3eab547e0b19da13468 Author: Zdenek Kabelac <[email protected]> AuthorDate: Sat Oct 12 23:40:15 2019 +0200 Committer: Zdenek Kabelac <[email protected]> CommitterDate: Mon Oct 14 15:14:25 2019 +0200
cache: recognize cachevol with lv_cache_remove
--- lib/metadata/cache_manip.c | 5 ++++- 1 files changed, 4 insertions(+), 1 deletions(-)
lib/metadata/cache_manip.c +4 -1
@@ -758,6 +758,7 @@ int lv_cache_remove(struct logical_volume *cache_lv)struct lv_segment *cache_seg =first_seg (cache_lv);struct logical_volume *corigin_lv;struct logical_volume *cache_pool_lv; +cache_mode_t cache_mode;int is_clear;if (!lv_is_cache (cache_lv)) {
@@ -783,7 +784,9 @@ int lv_cache_remove(struct logical_volume *cache_lv)if (!deactivate_lv_with_sub_lv (cache_lv)) return_0; -switch (first_seg (cache_seg->pool_lv)->cache_mode) { + cache_mode = (lv_is_cache_pool (cache_seg->pool_lv)) ? +first_seg (cache_seg->pool_lv)->cache_mode : cache_seg->cache_mode; +switch (cache_mode) {case CACHE_MODE_WRITETHROUGH :case CACHE_MODE_PASSTHROUGH :/* For inactive pass/writethrough just drop cache layer */