Do not allow reweight > 1

This commit is contained in:
Vitaliy Filippov
2025-04-05 12:21:14 +03:00
parent 013f688ffe
commit dfde0e60f0
2 changed files with 7 additions and 1 deletions
+6
View File
@@ -58,6 +58,12 @@ struct osd_changer_t
state = 100;
return;
}
if (set_reweight && new_reweight > 1)
{
result = (cli_result_t){ .err = EINVAL, .text = "Reweight can't be larger than 1" };
state = 100;
return;
}
parent->etcd_txn(json11::Json::object {
{ "success", json11::Json::array {
json11::Json::object {