From bc0980362895ab64fb9f11811dc72937fe92c8a7 Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Thu, 10 Sep 2020 17:39:43 +0200 Subject: [PATCH] lv_manip: relocate check to proper function --- lib/metadata/lv_manip.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index ba143075d..e2c0f957b 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -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; -- 2.43.5