From: Jason Dillaman Date: Fri, 23 Aug 2019 18:52:28 +0000 (-0400) Subject: rbd-nbd: shutdown should wait for pending IOs to complete X-Git-Tag: v15.1.0~1748^2 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=1c40cfc82e0883b9a03ebee39bb020e2bfb49972;p=ceph.git rbd-nbd: shutdown should wait for pending IOs to complete Previously it was incorrectly waiting for finished IOs to complete. The finished IO would have already been cleared by the writer thread at this point. Any remaining pending or finished IOs implies a failure / shutdown of the NBD device. Fixes: https://tracker.ceph.com/issues/41409? Signed-off-by: Jason Dillaman --- diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc index 1c56d73cb124..77d8e82e2997 100644 --- a/src/tools/rbd_nbd/rbd-nbd.cc +++ b/src/tools/rbd_nbd/rbd-nbd.cc @@ -227,7 +227,7 @@ private: { ceph_assert(!reader_thread.is_started()); std::unique_lock l{lock}; - cond.wait(l, [this] { return io_finished.empty(); }); + cond.wait(l, [this] { return io_pending.empty(); }); while(!io_finished.empty()) { std::unique_ptr free_ctx(io_finished.front());