From: xie xingguo Date: Sat, 24 Jun 2017 06:05:59 +0000 (+0800) Subject: mon/OSDMonitor: strict comparison condition X-Git-Tag: v12.1.2~1^2~27^2~5 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=412105bb5a563581790d03aadda5f21ba5f68830;p=ceph.git mon/OSDMonitor: strict comparison condition To match the specifications of straw_calc_version. Signed-off-by: xie xingguo --- diff --git a/src/mon/OSDMonitor.cc b/src/mon/OSDMonitor.cc index e4e848556ef..c7197c172c9 100644 --- a/src/mon/OSDMonitor.cc +++ b/src/mon/OSDMonitor.cc @@ -7682,7 +7682,7 @@ bool OSDMonitor::prepare_command_impl(MonOpRequestRef op, } if (tunable == "straw_calc_version") { - if (value < 0 || value > 1) { + if (value != 0 && value != 1) { ss << "value must be 0 or 1; got " << value; err = -EINVAL; goto reply;