Thread (241 messages) 241 messages, 14 authors, 2026-01-29
STALE157d

[PATCH 6.18 124/227] selftests/ublk: fix IO thread idle check

From: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Date: 2026-01-28 15:57:04
Also in: linux-patches
Subsystem: kernel selftest framework, the rest, ublk userspace block driver · Maintainers: Shuah Khan, Linus Torvalds, Ming Lei

6.18-stable review patch.  If anyone has any objections, please let me know.

------------------

From: Ming Lei <redacted>

[ Upstream commit 75aad5ffe099a1b1a342257236dc260493917ed2 ]

Include cmd_inflight in ublk_thread_is_done() check. Without this,
the thread may exit before all FETCH commands are completed, which
may cause device deletion to hang.

Fixes: 6aecda00b7d1 ("selftests: ublk: add kernel selftests for ublk")
Signed-off-by: Ming Lei <redacted>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 tools/testing/selftests/ublk/kublk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests/ublk/kublk.c
index 6b8123c12a7ae..0e863d13eaee4 100644
--- a/tools/testing/selftests/ublk/kublk.c
+++ b/tools/testing/selftests/ublk/kublk.c
@@ -718,7 +718,7 @@ static int ublk_thread_is_idle(struct ublk_thread *t)
 
 static int ublk_thread_is_done(struct ublk_thread *t)
 {
-	return (t->state & UBLKS_T_STOPPING) && ublk_thread_is_idle(t);
+	return (t->state & UBLKS_T_STOPPING) && ublk_thread_is_idle(t) && !t->cmd_inflight;
 }
 
 static inline void ublksrv_handle_tgt_cqe(struct ublk_thread *t,
-- 
2.51.0


Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help