mirror of
git://sourceware.org/git/lvm2.git
synced 2025-03-10 16:58:47 +03:00
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.
This commit is contained in:
parent
c356991fa8
commit
ffeeb5c1e7
@ -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;
|
||||
|
Loading…
x
Reference in New Issue
Block a user