From: Kamoltat Date: Fri, 4 Mar 2022 16:18:45 +0000 (+0000) Subject: mon/OSDMonitor.cc: cannot set target_size_ratio to negative X-Git-Tag: v18.0.0~1257^2~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=1b882054ba386d026a27fcd4f3b9f38e75a531cb;p=ceph-ci.git mon/OSDMonitor.cc: cannot set target_size_ratio to negative Throw an error when user set `target_size_ratio` to negative using the command: `osd pool set target_size_ratio ` Signed-off-by: Kamoltat --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 7a62573897d..9b2865cb507 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -8813,6 +8813,11 @@ int OSDMonitor::prepare_command_pool_set(const cmdmap_t& cmdmap, << "later before setting target_size_bytes"; return -EINVAL; } + } else if (var == "target_size_ratio") { + if (f < 0.0) { + ss << "target_size_ratio cannot be negative"; + return -EINVAL; + } } else if (var == "pg_num_min") { if (interr.length()) { ss << "error parsing int value '" << val << "': " << interr;