diff options
| author | Ming Lei <ming.lei@redhat.com> | 2026-01-13 16:58:00 +0800 |
|---|---|---|
| committer | Jens Axboe <axboe@kernel.dk> | 2026-01-21 07:54:55 -0700 |
| commit | 75aad5ffe099a1b1a342257236dc260493917ed2 (patch) | |
| tree | adab42fdcedec49777446b81c3a227ba910b49b9 /tools/testing | |
| parent | f5f2bad67a45cd1ef6f5b727da104694a81b3666 (diff) | |
selftests/ublk: fix IO thread idle check
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 <ming.lei@redhat.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'tools/testing')
| -rw-r--r-- | tools/testing/selftests/ublk/kublk.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/tools/testing/selftests/ublk/kublk.c b/tools/testing/selftests/ublk/kublk.c index 185ba553686a..f52431fe9b6c 100644 --- a/tools/testing/selftests/ublk/kublk.c +++ b/tools/testing/selftests/ublk/kublk.c @@ -753,7 +753,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, |
