summaryrefslogtreecommitdiffstats
path: root/src/mon
diff options
context:
space:
mode:
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>2014-03-10 01:20:14 +0100
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>2014-03-10 01:20:14 +0100
commit18bdee6d327dcc0a1fea5b09a4267ea5d28ba00b (patch)
tree31f1b523fa2a82370c3fd6af82130a79e2dbfcba /src/mon
parentosd_types.cc: add missing break in operator<< case handling (diff)
downloadceph-18bdee6d327dcc0a1fea5b09a4267ea5d28ba00b.tar.xz
ceph-18bdee6d327dcc0a1fea5b09a4267ea5d28ba00b.zip
MDSMonitor::prepare_command: fix "mds set"
CID 1160828 (#1 of 1): Operands don't affect result (CONSTANT_EXPRESSION_RESULT) result_independent_of_operands: !cmd_getval(g_ceph_context, cmdmap, std::string("var", std::allocator<char>()), var) < 0 is always false regardless of the values of its operands. This occurs as the logical operand of if. Remove '< 0' check, replaced with check if returned string is empty. Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
Diffstat (limited to 'src/mon')
-rw-r--r--src/mon/MDSMonitor.cc4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/mon/MDSMonitor.cc b/src/mon/MDSMonitor.cc
index 1e81eba9ad8..ddec8996949 100644
--- a/src/mon/MDSMonitor.cc
+++ b/src/mon/MDSMonitor.cc
@@ -828,8 +828,10 @@ bool MDSMonitor::prepare_command(MMonCommand *m)
ss << "max_mds = " << pending_mdsmap.max_mds;
} else if (prefix == "mds set") {
string var;
- if (!cmd_getval(g_ceph_context, cmdmap, "var", var) < 0)
+ if (!cmd_getval(g_ceph_context, cmdmap, "var", var) || var.empty()) {
+ ss << "Invalid variable";
goto out;
+ }
string val;
string interr;
int64_t n = 0;