]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: fix locking in preinit error paths 7353/head
authorrenhwztetecs <rhwlyw@163.com>
Tue, 26 Jan 2016 01:51:16 +0000 (09:51 +0800)
committerrenhwztetecs <rhwlyw@163.com>
Tue, 26 Jan 2016 01:51:16 +0000 (09:51 +0800)
fix locking in preinit error paths

Fixes: #14473
Signed-off-by: huanwen ren <ren.huanwen@zte.com.cn>
src/mon/Monitor.cc

index e54e55e76e44de9a88d2db40bd8cf933ed23ee57..0ae8e170697063eba7c7cc64aa451bac93054e7b 100644 (file)
@@ -550,6 +550,7 @@ int Monitor::preinit()
   int r = sanitize_options();
   if (r < 0) {
     derr << "option sanitization failed!" << dendl;
+    lock.Unlock();
     return r;
   }
 
@@ -639,6 +640,7 @@ int Monitor::preinit()
               << "'mon_force_quorum_join' is set -- allowing boot" << dendl;
     } else {
       derr << "commit suicide!" << dendl;
+      lock.Unlock();
       return -ENOENT;
     }
   }