]> git.apps.os.sepia.ceph.com Git - ceph-ci.git/commitdiff
os/bluestore: fix false assertion
authorIgor Fedotov <ifedotov@mirantis.com>
Wed, 24 May 2017 13:54:42 +0000 (06:54 -0700)
committerIgor Fedotov <ifedotov@mirantis.com>
Wed, 24 May 2017 14:01:46 +0000 (07:01 -0700)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
src/os/bluestore/BlockDevice.h
src/os/bluestore/KernelDevice.cc

index eb783a89269c12119f7c149e24a09f056d487a45..f2b48f05a8bd7c3a8b746b52e2aaa1b889dc78f9 100644 (file)
@@ -63,10 +63,15 @@ public:
 
   void try_aio_wake() {
     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);
+      assert(num_running >= 0);
     } else {
       --num_running;
     }
index 0ee44c13a7c8ca54f30dc67300b6738536f35605..a87573f62790948cc7517fb49a56ea3069958dd9 100644 (file)
@@ -380,7 +380,7 @@ void KernelDevice::_aio_thread()
            aio_callback(aio_callback_priv, ioc->priv);
          }
        } else {
-            ioc->try_aio_wake();
+          ioc->try_aio_wake();
        }
       }
     }