]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
rbd-nbd: shutdown should wait for pending IOs to complete 29858/head
authorJason Dillaman <dillaman@redhat.com>
Fri, 23 Aug 2019 18:52:28 +0000 (14:52 -0400)
committerJason Dillaman <dillaman@redhat.com>
Fri, 23 Aug 2019 19:05:39 +0000 (15:05 -0400)
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 <dillaman@redhat.com>
src/tools/rbd_nbd/rbd-nbd.cc

index 1c56d73cb124fcbcdccc970851f20bd1355d59dd..77d8e82e29979ec64d76708641105fa90c9d4483 100644 (file)
@@ -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<IOContext> free_ctx(io_finished.front());