]> sourceware.org Git - lvm2.git/commitdiff
lv_manip: relocate check to proper function
authorZdenek Kabelac <zkabelac@redhat.com>
Thu, 10 Sep 2020 15:39:43 +0000 (17:39 +0200)
committerZdenek Kabelac <zkabelac@redhat.com>
Thu, 10 Sep 2020 21:54:33 +0000 (23:54 +0200)
lib/metadata/lv_manip.c

index ba143075d538c2b846f23eb394d6539ccf0cc26c..e2c0f957b9f8cacc21fff85a91e70481c8b9f4a8 100644 (file)
@@ -5068,6 +5068,11 @@ static int _lvresize_check(struct logical_volume *lv,
        struct volume_group *vg = lv->vg;
        struct lv_segment *seg = first_seg(lv);
 
+       if (lv_is_writecache(lv)) {
+               log_error("Resize not yet allowed on LVs with writecache attached.");
+               return 0;
+       }
+
        if (lv_is_external_origin(lv)) {
                /*
                 * Since external-origin can be activated read-only,
@@ -5792,11 +5797,6 @@ int lv_resize(struct logical_volume *lv,
        struct device *dev;
        char name[PATH_MAX];
 
-       if (lv_is_writecache(lv)) {
-               log_error("Resize not yet allowed on LVs with writecache attached.");
-               return 0;
-       }
-
        if (!_lvresize_check(lv, lp))
                return_0;
 
This page took 0.067144 seconds and 5 git commands to generate.