mirror of
git://sourceware.org/git/lvm2.git
synced 2025-08-31 09:49:29 +03:00
raid: lvcreate and lvchange fail if --min_recovery_rate is defined
Both commands default [raid_](min|max)recoveryrate to 0 but ensure min_recovery_rate is not larger than max_recoveryrate. This results in command failure without requestinng the user to also define max_recovery_rate >= min_recovery_rate. Fix both commands by defining max_recovery_rate = min_recoveryrate in case "lvcreate/lvchange --minrecoveryrate Size ..." requests a larger value than current maxrecoveryrate without also giving option "--maxrecoveryrate Size ..." with a size greater or equal than min.
This commit is contained in:
@ -1013,8 +1013,8 @@ static int _lvchange_recovery_rate(struct logical_volume *lv,
|
|||||||
|
|
||||||
if (raid_seg->max_recovery_rate &&
|
if (raid_seg->max_recovery_rate &&
|
||||||
(raid_seg->max_recovery_rate < raid_seg->min_recovery_rate)) {
|
(raid_seg->max_recovery_rate < raid_seg->min_recovery_rate)) {
|
||||||
log_error("Minimum recovery rate cannot be higher than maximum.");
|
log_print_unless_silent("Minimum recovery rate cannot be higher than maximum, adjusting.");
|
||||||
return 0;
|
raid_seg->max_recovery_rate = raid_seg->min_recovery_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Request caller to commit and reload metadata */
|
/* Request caller to commit and reload metadata */
|
||||||
|
@ -595,8 +595,8 @@ static int _read_raid_params(struct cmd_context *cmd,
|
|||||||
lp->max_recovery_rate = arg_uint_value(cmd, maxrecoveryrate_ARG, 0) / 2;
|
lp->max_recovery_rate = arg_uint_value(cmd, maxrecoveryrate_ARG, 0) / 2;
|
||||||
|
|
||||||
if (lp->min_recovery_rate > lp->max_recovery_rate) {
|
if (lp->min_recovery_rate > lp->max_recovery_rate) {
|
||||||
log_error("Minimum recovery rate cannot be higher than maximum.");
|
log_print_unless_silent("Minimum recovery rate cannot be higher than maximum, adjusting.");
|
||||||
return 0;
|
lp->max_recovery_rate > lp->min_recovery_rate;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (lp->region_size < lp->stripe_size) {
|
if (lp->region_size < lp->stripe_size) {
|
||||||
|
Reference in New Issue
Block a user