Skip to content

Commit 75aad5f

Browse files
Ming Leiaxboe
authored andcommitted
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: 6aecda0 ("selftests: ublk: add kernel selftests for ublk") Signed-off-by: Ming Lei <ming.lei@redhat.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent f5f2bad commit 75aad5f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

  • tools/testing/selftests/ublk

tools/testing/selftests/ublk/kublk.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,7 @@ static int ublk_thread_is_idle(struct ublk_thread *t)
753753

754754
static int ublk_thread_is_done(struct ublk_thread *t)
755755
{
756-
return (t->state & UBLKS_T_STOPPING) && ublk_thread_is_idle(t);
756+
return (t->state & UBLKS_T_STOPPING) && ublk_thread_is_idle(t) && !t->cmd_inflight;
757757
}
758758

759759
static inline void ublksrv_handle_tgt_cqe(struct ublk_thread *t,

0 commit comments

Comments
 (0)