]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: missing lock release in DaemonServer::handle_report() 30706/head
authorVenky Shankar <vshankar@redhat.com>
Thu, 3 Oct 2019 11:33:43 +0000 (17:03 +0530)
committerVenky Shankar <vshankar@redhat.com>
Sun, 6 Oct 2019 06:47:43 +0000 (02:47 -0400)
Fixes: http://tracker.ceph.com/issues/42169
Introduced-by: 5c25a01864
Signed-off-by: Venky Shankar <vshankar@redhat.com>
src/mgr/DaemonServer.cc

index 915a5c814aedb50d8f078a8adea58f188d66a631..21b389d61e6c9bf16a8a9958927361aa42d74f7e 100644 (file)
@@ -505,7 +505,7 @@ bool DaemonServer::handle_report(const ref_t<MMgrReport>& 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<MMgrReport>& 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<MMgrReport>& 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<MMgrReport>& m)
         daemon_connections.erase(iter);
       }
 
-      lock.unlock();
       return false;
     }
 
@@ -610,8 +609,6 @@ bool DaemonServer::handle_report(const ref_t<MMgrReport>& m)
                  << dendl;
       }
     }
-
-    lock.unlock();
   }
 
   // if there are any schema updates, notify the python modules