Commit 75aad5ff authored by Ming Lei's avatar Ming Lei Committed by Jens Axboe
Browse files

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: 6aecda00 ("selftests: ublk: add kernel selftests for ublk")
Signed-off-by: default avatarMing Lei <ming.lei@redhat.com>
Signed-off-by: default avatarJens Axboe <axboe@kernel.dk>
parent f5f2bad6
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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,