From 3015f304db4c1d4fef47ac1c10b8e995de9401ae Mon Sep 17 00:00:00 2001 From: Sage Weil Date: Wed, 22 Mar 2017 11:36:01 -0500 Subject: [PATCH] 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 --- src/mgr/MgrClient.cc | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/mgr/MgrClient.cc b/src/mgr/MgrClient.cc index 5301253654ffe..e1fa439c2fd55 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; } -- 2.39.5