]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fixup access a destroy cond cause deadlock or undefine 26261/head
authorlinbing <hawkerous@gmail.com>
Fri, 21 Dec 2018 00:22:30 +0000 (08:22 +0800)
committerPrashant D <pdhange@redhat.com>
Mon, 4 Feb 2019 00:14:28 +0000 (19:14 -0500)
              behavior.

Fixes: https://tracker.ceph.com/issues/37733
Signed-off-by: linbing <linbing@t2cloud.net>
(cherry picked from commit dbbde306484276251cbd7a7b7a6fde0093f98ba2)

Conflicts:
src/os/bluestore/BlockDevice.h : Resolved in try_aio_wake

src/os/bluestore/BlockDevice.h

index 280e650cb36538fc63c9a42ac1738cd0b9bdf8cb..bd74f81306d5fcecabe576b1698e7b97b9bda473 100644 (file)
@@ -64,13 +64,13 @@ public:
   void aio_wait();
 
   void try_aio_wake() {
+    std::lock_guard<std::mutex> l(lock);
     if (num_running == 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<std::mutex> l(lock);
       cond.notify_all();
       --num_running;
       assert(num_running >= 0);