From: Brad Hubbard Date: Wed, 12 Apr 2017 06:21:51 +0000 (+1000) Subject: mds: Return error message instead of asserting X-Git-Tag: v12.0.2~73^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=refs%2Fpull%2F14469%2Fhead;p=ceph.git mds: Return error message instead of asserting For "session evict" admin socket command return an error message when we receive an invalid/missing client_id parameter rather than asserting. Signed-off-by: Brad Hubbard --- diff --git a/src/mds/MDSRank.cc b/src/mds/MDSRank.cc index eb538f9c849e..83cd92796d63 100644 --- a/src/mds/MDSRank.cc +++ b/src/mds/MDSRank.cc @@ -1760,13 +1760,18 @@ bool MDSRankDispatcher::handle_asok_command( } else if (command == "session evict") { std::string client_id; const bool got_arg = cmd_getval(g_ceph_context, cmdmap, "client_id", client_id); - assert(got_arg == true); + if(!got_arg) { + ss << "Invalid client_id specified"; + return true; + } mds_lock.Lock(); - std::stringstream ss; - bool killed = kill_session(strtol(client_id.c_str(), 0, 10), true, ss); - if (!killed) - dout(15) << ss.str() << dendl; + stringstream dss; + bool killed = kill_session(strtol(client_id.c_str(), 0, 10), true, dss); + if (!killed) { + dout(15) << dss.str() << dendl; + ss << dss.str(); + } mds_lock.Unlock(); } else if (command == "scrub_path") { string path;