]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mgr: missing lock release in DaemonServer::handle_report()
authorVenky Shankar <vshankar@redhat.com>
Thu, 3 Oct 2019 11:33:43 +0000 (17:03 +0530)
committerVenky Shankar <vshankar@redhat.com>
Thu, 26 Mar 2020 02:44:12 +0000 (22:44 -0400)
Fixes: http://tracker.ceph.com/issues/42169
Introduced-by: 5c25a01864
Signed-off-by: Venky Shankar <vshankar@redhat.com>
(cherry picked from commit cda3eadbfbd3e3a8a057cc7ed042ba0a6d7fef11)

src/mgr/DaemonServer.cc

index 7595f47c8d806992f4c3def4ea881dece001865f..75ff7c39685f763fbf256b3df3592afc4e79d5f7 100644 (file)
@@ -559,7 +559,7 @@ bool DaemonServer::handle_report(MMgrReport *m)
 
 
   {
-    lock.lock();
+    std::unique_lock locker(lock);
 
     DaemonStatePtr daemon;
     // Look up the DaemonState
@@ -567,7 +567,7 @@ bool DaemonServer::handle_report(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."
@@ -597,7 +597,7 @@ bool DaemonServer::handle_report(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();
@@ -619,7 +619,6 @@ bool DaemonServer::handle_report(MMgrReport *m)
         daemon_connections.erase(iter);
       }
 
-      lock.unlock();
       return false;
     }
 
@@ -664,8 +663,6 @@ bool DaemonServer::handle_report(MMgrReport *m)
                  << dendl;
       }
     }
-
-    lock.unlock();
   }
 
   // if there are any schema updates, notify the python modules