From: Sage Weil Date: Wed, 30 Oct 2019 14:39:47 +0000 (-0500) Subject: mgr/MgrClient: fix open condition X-Git-Tag: v15.1.0~1085^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=fc60989bf7a72c35b8f6b8fec2407b3080ad9bbd;p=ceph.git mgr/MgrClient: fix open condition Do not open a mgr daemon session if we are a client using a non-client key to authenticate. This is a bit of a corner case, but it can happen when using the mon. key do bootstrap functions. This aligns the MgrClient condition with the mgr/DaemonServer.cc handle_report condition, which rejects non-daemon client connections based on the connection entity type, not the auth identity. Fixes: https://tracker.ceph.com/issues/42566 Signed-off-by: Sage Weil --- diff --git a/src/mgr/MgrClient.cc b/src/mgr/MgrClient.cc index 94ff99c390f..0f24ab8171e 100644 --- a/src/mgr/MgrClient.cc +++ b/src/mgr/MgrClient.cc @@ -183,7 +183,7 @@ void MgrClient::reconnect() // Don't send an open if we're just a client (i.e. doing // command-sending, not stats etc) - if (!cct->_conf->name.is_client() || service_daemon) { + if (msgr->get_mytype() != CEPH_ENTITY_TYPE_CLIENT || service_daemon) { _send_open(); } @@ -574,7 +574,7 @@ int MgrClient::service_daemon_register( daemon_dirty_status = true; // late register? - if (cct->_conf->name.is_client() && session && session->con) { + if (msgr->get_mytype() != CEPH_ENTITY_TYPE_CLIENT && session && session->con) { _send_open(); }