]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/bluestore: fixup access a destroy cond cause deadlock or undefine 26260/head
authorlinbing <hawkerous@gmail.com>
Fri, 21 Dec 2018 00:22:30 +0000 (08:22 +0800)
committerPrashant D <pdhange@redhat.com>
Sun, 3 Feb 2019 23:58:41 +0000 (18:58 -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 262619919c482234467fd186a9d60923bcf1f98a..b5db16f8152c2d354b1c062ecfb575cd0e6ec372 100644 (file)
@@ -77,13 +77,13 @@ public:
   uint64_t get_num_ios() const;
 
   void try_aio_wake() {
+    std::lock_guard 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;
       ceph_assert(num_running >= 0);