From d1322dba2e74de21388ad524c942288683712599 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 23 Aug 2019 14:45:21 -0400 Subject: [PATCH 1/2] test/librbd: set nbd timeout due to newer kernels defaulting it on Fixes: https://tracker.ceph.com/issues/41409 Signed-off-by: Jason Dillaman --- src/test/librbd/fsx.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/test/librbd/fsx.cc b/src/test/librbd/fsx.cc index 25766b5002d..4318b1ce462 100644 --- a/src/test/librbd/fsx.cc +++ b/src/test/librbd/fsx.cc @@ -1230,6 +1230,7 @@ nbd_open(const char *name, struct rbd_ctx *ctx) SubProcess process("rbd-nbd", SubProcess::KEEP, SubProcess::PIPE, SubProcess::KEEP); process.add_cmd_arg("map"); + process.add_cmd_arg("--timeout=600"); std::string img; img.append(pool); img.append("/"); From 1c40cfc82e0883b9a03ebee39bb020e2bfb49972 Mon Sep 17 00:00:00 2001 From: Jason Dillaman Date: Fri, 23 Aug 2019 14:52:28 -0400 Subject: [PATCH 2/2] 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 --- src/tools/rbd_nbd/rbd-nbd.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/tools/rbd_nbd/rbd-nbd.cc b/src/tools/rbd_nbd/rbd-nbd.cc index 1c56d73cb12..77d8e82e299 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());