]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
tools/cephfs: fix lock
authorxie xingguo <xie.xingguo@zte.com.cn>
Mon, 6 Jun 2016 01:26:34 +0000 (09:26 +0800)
committerxie xingguo <xie.xingguo@zte.com.cn>
Mon, 6 Jun 2016 02:19:55 +0000 (10:19 +0800)
We shall release lock on error exit.

Signed-off-by: xie xingguo <xie.xingguo@zte.com.cn>
src/tools/cephfs/Resetter.cc

index f1102f35a483b69e36524ae91fff9d0f8a07237e..6fd51d8b262535d44ca4d773c694962b949cdb9b 100644 (file)
@@ -95,8 +95,8 @@ int Resetter::reset(mds_role_t role)
   while (!done)
     cond.Wait(mylock);
   mylock.Unlock();
-    
-  lock.Lock();
+
+  Mutex::Locker l(lock);
   if (r != 0) {
     return r;
   }
@@ -106,8 +106,6 @@ int Resetter::reset(mds_role_t role)
     return r;
   }
 
-  lock.Unlock();
-
   cout << "done" << std::endl;
 
   return 0;