From cda3eadbfbd3e3a8a057cc7ed042ba0a6d7fef11 Mon Sep 17 00:00:00 2001 From: Venky Shankar Date: Thu, 3 Oct 2019 17:03:43 +0530 Subject: [PATCH] mgr: missing lock release in DaemonServer::handle_report() Fixes: http://tracker.ceph.com/issues/42169 Introduced-by: 5c25a01864 Signed-off-by: Venky Shankar --- src/mgr/DaemonServer.cc | 9 +++------ 1 file changed, 3 insertions(+), 6 deletions(-) diff --git a/src/mgr/DaemonServer.cc b/src/mgr/DaemonServer.cc index 915a5c814ae..21b389d61e6 100644 --- a/src/mgr/DaemonServer.cc +++ b/src/mgr/DaemonServer.cc @@ -505,7 +505,7 @@ bool DaemonServer::handle_report(const ref_t& m) { - lock.lock(); + std::unique_lock locker(lock); DaemonStatePtr daemon; // Look up the DaemonState @@ -513,7 +513,7 @@ bool DaemonServer::handle_report(const ref_t& m) dout(20) << "updating existing DaemonState for " << key << dendl; daemon = daemon_state.get(key); } else { - lock.unlock(); + locker.unlock(); // we don't know the hostname at this stage, reject MMgrReport here. dout(5) << "rejecting report from " << key << ", since we do not have its metadata now." @@ -543,7 +543,7 @@ bool DaemonServer::handle_report(const ref_t& m) monc->start_mon_command({oss.str()}, {}, &c->outbl, &c->outs, c); } - lock.lock(); + locker.lock(); // kill session auto priv = m->get_connection()->get_priv(); @@ -565,7 +565,6 @@ bool DaemonServer::handle_report(const ref_t& m) daemon_connections.erase(iter); } - lock.unlock(); return false; } @@ -610,8 +609,6 @@ bool DaemonServer::handle_report(const ref_t& m) << dendl; } } - - lock.unlock(); } // if there are any schema updates, notify the python modules -- 2.39.5