From a6ab54b1ba6e3d96ccfa38fb94afbc8e09fc3819 Mon Sep 17 00:00:00 2001 From: Vitaliy Filippov Date: Sat, 30 Dec 2023 19:47:20 +0300 Subject: [PATCH] Do not allow negative util_low/high --- src/osd.cpp | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/src/osd.cpp b/src/osd.cpp index 645188ed..b85e7210 100644 --- a/src/osd.cpp +++ b/src/osd.cpp @@ -211,12 +211,20 @@ void osd_t::parse_config(bool init) recovery_sleep_us = config["recovery_sleep_us"].uint64_value(); recovery_tune_util_low = config["recovery_tune_util_low"].is_null() ? 0.1 : config["recovery_tune_util_low"].number_value(); + if (recovery_tune_util_low < 0.01) + recovery_tune_util_low = 0.01; recovery_tune_util_high = config["recovery_tune_util_high"].is_null() ? 1.0 : config["recovery_tune_util_high"].number_value(); + if (recovery_tune_util_high < 0.01) + recovery_tune_util_high = 0.01; recovery_tune_client_util_low = config["recovery_tune_client_util_low"].is_null() ? 0 : config["recovery_tune_client_util_low"].number_value(); + if (recovery_tune_client_util_low < 0.01) + recovery_tune_client_util_low = 0.01; recovery_tune_client_util_high = config["recovery_tune_client_util_high"].is_null() ? 0.5 : config["recovery_tune_client_util_high"].number_value(); + if (recovery_tune_client_util_high < 0.01) + recovery_tune_client_util_high = 0.01; auto old_recovery_tune_interval = recovery_tune_interval; recovery_tune_interval = config["recovery_tune_interval"].is_null() ? 1 : config["recovery_tune_interval"].uint64_value();