From: Sage Weil Date: Wed, 22 Mar 2017 16:36:01 +0000 (-0500) Subject: mgr/MgrClient: assume missing MgrMap means no acces to mgr at all X-Git-Tag: v12.0.2~252^2~7 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=3015f304db4c1d4fef47ac1c10b8e995de9401ae;p=ceph.git mgr/MgrClient: assume missing MgrMap means no acces to mgr at all If we get as far as authenticating and have no MgrMap that implies the mon didn't provide us one (despite our request) and we have no access to the mgr at all. Signed-off-by: Sage Weil --- diff --git a/src/mgr/MgrClient.cc b/src/mgr/MgrClient.cc index 5301253654ff..e1fa439c2fd5 100644 --- a/src/mgr/MgrClient.cc +++ b/src/mgr/MgrClient.cc @@ -289,7 +289,10 @@ int MgrClient::start_command(const vector& cmd, const bufferlist& inbl, ldout(cct, 20) << "cmd: " << cmd << dendl; - assert(map.epoch > 0); + if (map.epoch == 0) { + ldout(cct,20) << " no MgrMap, assuming EACCES" << dendl; + return -EACCES; + } auto &op = command_table.start_command(); op.cmd = cmd; @@ -303,7 +306,6 @@ int MgrClient::start_command(const vector& cmd, const bufferlist& inbl, MCommand *m = op.get_message({}); session->con->send_message(m); } - return 0; }