]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr/MgrClient: assume missing MgrMap means no acces to mgr at all
authorSage Weil <sage@redhat.com>
Wed, 22 Mar 2017 16:36:01 +0000 (11:36 -0500)
committerSage Weil <sage@redhat.com>
Wed, 29 Mar 2017 15:39:27 +0000 (11:39 -0400)
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 <sage@redhat.com>
src/mgr/MgrClient.cc

index 5301253654ffe792a0e35461f00f6675c21879e7..e1fa439c2fd55c98f2f812f81b7c524a07ad5aa2 100644 (file)
@@ -289,7 +289,10 @@ int MgrClient::start_command(const vector<string>& 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<string>& cmd, const bufferlist& inbl,
     MCommand *m = op.get_message({});
     session->con->send_message(m);
   }
-
   return 0;
 }