diff options
author | Zdenek Kabelac <zkabelac@redhat.com> | 2015-09-14 12:58:21 +0200 |
---|---|---|
committer | Zdenek Kabelac <zkabelac@redhat.com> | 2015-09-14 20:18:54 +0200 |
commit | ffeeb5c1e70e554defa45ee8aa28dcaeb47c705f (patch) | |
tree | 01c5622df362d680cf3a62eda3b4845c03668ee6 | |
parent | c356991fa83b15af261e8d7e33f5615397c07778 (diff) | |
download | lvm2-ffeeb5c1e70e554defa45ee8aa28dcaeb47c705f.tar.gz |
thin: show message on error path
Add missing log_error and show proper reason for failure
when autoextend is set to 0.
Add missing log_error when checked LV is not locally active.
-rw-r--r-- | lib/metadata/lv_manip.c | 13 |
1 files changed, 11 insertions, 2 deletions
diff --git a/lib/metadata/lv_manip.c b/lib/metadata/lv_manip.c index f43d281a9..46213fe99 100644 --- a/lib/metadata/lv_manip.c +++ b/lib/metadata/lv_manip.c @@ -4405,8 +4405,11 @@ static int _adjust_policy_params(struct cmd_context *cmd, policy_amount = find_config_tree_int(cmd, activation_thin_pool_autoextend_percent_CFG, lv_config_profile(lv)); - if (!policy_amount && policy_threshold < DM_PERCENT_100) - return 0; + if (!policy_amount && policy_threshold < DM_PERCENT_100) { + log_error("Can't extend thin pool %s, autoextend is set to 0%%.", + display_lvname(lv)); + return 0; + } } else { policy_threshold = find_config_tree_int(cmd, activation_snapshot_autoextend_threshold_CFG, NULL) * DM_PERCENT_1; @@ -4417,6 +4420,12 @@ static int _adjust_policy_params(struct cmd_context *cmd, if (policy_threshold >= DM_PERCENT_100) return 1; /* nothing to do */ + if (!lv_is_active_locally(lv)) { + log_error("Can't read state of locally inactive LV %s.", + display_lvname(lv)); + return 0; + } + if (lv_is_thin_pool(lv)) { if (!lv_thin_pool_percent(lv, 1, &percent)) return_0; |