]> sourceware.org Git - lvm2.git/commitdiff
cache: correct condition
authorZdenek Kabelac <zkabelac@redhat.com>
Sat, 12 Oct 2019 21:40:58 +0000 (23:40 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Mon, 14 Oct 2019 13:14:25 +0000 (15:14 +0200)
lib/metadata/cache_manip.c

index e444e37b7c033d81a008e6202281887e66d709cc..1a5482b10b0526408162b2e80fc03cb77fe1f449 100644 (file)
@@ -1434,8 +1434,7 @@ int wipe_cache_pool(struct logical_volume *cache_pool_lv)
        int r;
 
        /* Only unused cache-pool could be activated and wiped */
-       if ((!lv_is_cache_pool(cache_pool_lv) && !lv_is_cache_vol(cache_pool_lv)) ||
-           !dm_list_empty(&cache_pool_lv->segs_using_this_lv)) {
+       if (lv_is_used_cache_pool(cache_pool_lv) || lv_is_cache_vol(cache_pool_lv)) {
                log_error(INTERNAL_ERROR "Failed to wipe cache pool for volume %s.",
                          display_lvname(cache_pool_lv));
                return 0;
This page took 0.030771 seconds and 5 git commands to generate.