diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2019-10-02 14:50:12 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2019-10-04 17:31:55 +0200 |
commit | 6a9a4b45341cc62b103bf167e96bbdb5f542476e (patch) | |
tree | a7ada213fc4bea5e052d9abc5e59b2e568ead8ad | |
parent | cb5f0bdba988c826b8edee06e139cff62eeffeb8 (diff) | |
download | lvm2-6a9a4b45341cc62b103bf167e96bbdb5f542476e.tar.gz |
resize: continue change for getting vdo status before resize
Continue commit a98b77c16455ee97f5bd4b89536a3ae4efd8e009.
There needs to be error reported when status can't be obtained.
-rw-r--r-- | lib/metadata/lv_manip.c | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index 47ff1672a..ebdb0cbbc 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4852,7 +4852,7 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv, if (lv_is_thin_pool(lv)) { if (!lv_thin_pool_percent(lv, 1, &percent)) - return_0; + goto_bad; /* Resize below the minimal usable value */ min_threshold = pool_metadata_min_threshold(first_seg(lv)) / DM_PERCENT_1; @@ -4860,13 +4860,14 @@ static int _lvresize_adjust_policy(const struct logical_volume *lv, min_threshold : policy_threshold, policy_amount); if (!lv_thin_pool_percent(lv, 0, &percent)) - return_0; + goto_bad; } else if (lv_is_vdo_pool(lv)) { if (!lv_vdo_pool_percent(lv, &percent)) - return_0; + goto_bad; } else if (!lv_snapshot_percent(lv, &percent)) - return_0; + goto_bad; else if (!lv_is_active(lv)) { + bad: log_error("Can't read state of locally inactive LV %s.", display_lvname(lv)); return 0; |