]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fixup access a destroy cond cause deadlock or undefine 25659/head
authorlinbing <hawkerous@gmail.com>
Fri, 21 Dec 2018 00:22:30 +0000 (08:22 +0800)
committerlinbing <hawkerous@gmail.com>
Mon, 24 Dec 2018 00:11:06 +0000 (08:11 +0800)
              behavior.

Fixes: https://tracker.ceph.com/issues/37733
Signed-off-by: linbing <linbing@t2cloud.net>
src/os/bluestore/BlockDevice.h

index 5faa26073bafe8a9068f36100c0892e2e60509e0..ad60ab32cd440f49985df713c90908ff91a548bf 100644 (file)
@@ -95,13 +95,14 @@ public:
 
   void try_aio_wake() {
     assert(num_running >= 1);
+
+    std::lock_guard l(lock);
     if (num_running.fetch_sub(1) == 1) {
 
       // we might have some pending IOs submitted after the check
       // as there is no lock protection for aio_submit.
       // Hence we might have false conditional trigger.
       // aio_wait has to handle that hence do not care here.
-      std::lock_guard l(lock);
       cond.notify_all();
     }
   }