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: v16.2.8~82^2~2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1eb82bbe3311a607f454d9d9bee2441000eaf1a3;p=ceph.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 (cherry picked from commit 1b882054ba386d026a27fcd4f3b9f38e75a531cb) --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index 1ea1029dbea..332673821c7 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -8745,6 +8745,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;