From: Igor Fedotov Date: Wed, 24 May 2017 13:54:42 +0000 (-0700) Subject: os/bluestore: fix false assertion X-Git-Tag: v12.1.0~405^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=5f53346dc276c69aa12dfd0eccdac880242b4e24;p=ceph-ci.git os/bluestore: fix false assertion Signed-off-by: Igor Fedotov --- diff --git a/src/os/bluestore/BlockDevice.h b/src/os/bluestore/BlockDevice.h index eb783a89269..f2b48f05a8b 100644 --- a/src/os/bluestore/BlockDevice.h +++ b/src/os/bluestore/BlockDevice.h @@ -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 l(lock); cond.notify_all(); --num_running; - assert(num_running == 0); + assert(num_running >= 0); } else { --num_running; } diff --git a/src/os/bluestore/KernelDevice.cc b/src/os/bluestore/KernelDevice.cc index 0ee44c13a7c..a87573f6279 100644 --- a/src/os/bluestore/KernelDevice.cc +++ b/src/os/bluestore/KernelDevice.cc @@ -380,7 +380,7 @@ void KernelDevice::_aio_thread() aio_callback(aio_callback_priv, ioc->priv); } } else { - ioc->try_aio_wake(); + ioc->try_aio_wake(); } } }