Fix OSD reweight values between 0 and 1 not working

This commit is contained in:
Vitaliy Filippov
2025-09-05 02:05:01 +03:00
parent 47c7aa62de
commit df604afbd5
4 changed files with 62 additions and 1 deletions
+1 -1
View File
@@ -15,7 +15,7 @@ function get_osd_tree(global_config, state)
const stat = state.osd.stats[osd_num];
const osd_cfg = state.config.osd[osd_num];
let reweight = osd_cfg == null ? 1 : Number(osd_cfg.reweight);
if (isNaN(reweight) || reweight < 0 || reweight > 0)
if (isNaN(reweight) || reweight < 0 || reweight > 1)
reweight = 1;
if (stat && stat.size && reweight && (state.osd.state[osd_num] || Number(stat.time) >= down_time ||
osd_cfg && osd_cfg.noout))