]> sourceware.org Git - lvm2.git/commitdiff
cache: validate for locked
authorZdenek Kabelac <zkabelac@redhat.com>
Mon, 20 Oct 2014 12:58:29 +0000 (14:58 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Fri, 24 Oct 2014 14:39:31 +0000 (16:39 +0200)
Add extra safety.

WHATS_NEW
lib/metadata/cache_manip.c

index f5b79317fbb9238784a0516af37965bff639dae1..8b9cf6f09339f859414dc10d9eb6781fa87084fb 100644 (file)
--- a/WHATS_NEW
+++ b/WHATS_NEW
@@ -1,5 +1,6 @@
 Version 2.02.112 - 
 =====================================
+  Add extra validate for locked lv within validate_lv_cache_create().
   Add internal lvseg_name() function.
   Skip trying to file lock virtual internal vg name.
   Fix selection on {vg,lv}_permissions fields to properly match selection criteria.
index 0a6daf6a14ffed43d72eda241010c0268a64f8c5..837c6518ba6f15d36328ec734f0dc88ed7ec08bf 100644 (file)
@@ -104,6 +104,12 @@ int validate_lv_cache_create(const struct logical_volume *pool_lv,
                        return 0;
                }
 
+               if (lv_is_locked(pool_lv)) {
+                       log_error("Cannot use locked cache pool %s.",
+                                 display_lvname(pool_lv));
+                       return 0;
+               }
+
                if (origin_lv == pool_lv) {
                        log_error("Can't use same LV %s for cache pool and cache volume.",
                                  display_lvname(pool_lv));
@@ -119,6 +125,12 @@ int validate_lv_cache_create(const struct logical_volume *pool_lv,
                }
        }
 
+       if (lv_is_locked(origin_lv)) {
+               log_error("Cannot use locked origin volume %s.",
+                         display_lvname(origin_lv));
+               return 0;
+       }
+
        /* For now we only support conversion of thin pool data volume */
        if (!lv_is_visible(origin_lv) && !lv_is_thin_pool_data(origin_lv)) {
                log_error("Can't convert internal LV %s.", display_lvname(origin_lv));
This page took 0.042449 seconds and 5 git commands to generate.