]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
client: fix leak of client_lock when not initialized
authorSage Weil <sage@inktank.com>
Tue, 17 Jul 2012 19:38:50 +0000 (12:38 -0700)
committerSage Weil <sage@inktank.com>
Wed, 18 Jul 2012 02:18:55 +0000 (19:18 -0700)
Backport: argonaut
Signed-off-by: Sage Weil <sage@inktank.com>
src/client/Client.cc

index 9c1ee5011640b3b4a38514be84f8350494cb71fd..b5e44b8fae5c6686889bd94df3cd8369605db9ff 100644 (file)
@@ -1473,7 +1473,7 @@ void Client::handle_client_reply(MClientReply *reply)
 
 bool Client::ms_dispatch(Message *m)
 {
-  client_lock.Lock();
+  Mutex::Locker l(client_lock);
   if (!initialized) {
     ldout(cct, 10) << "inactive, discarding " << *m << dendl;
     m->put();
@@ -1538,8 +1538,6 @@ bool Client::ms_dispatch(Message *m)
     }
   }
 
-  client_lock.Unlock();
-
   return true;
 }