Skip to content

Commit bc674a0

Browse files
isilenceaxboe
authored andcommitted
io_uring/zcrx: recheck ifq on shutdown
io_ring_exit_work() checks ifq before shutting it down and guarantees that the pointer is stable, but instead of relying on rather complicated synchronisation recheck the ifq pointer inside. Reported-by: Kees Bakker <[email protected]> Signed-off-by: Pavel Begunkov <[email protected]> Link: https://lore.kernel.org/r/905e55c47235ab26377a735294f939f31d00ae53.1739934175.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <[email protected]>
1 parent 71082fa commit bc674a0

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

io_uring/zcrx.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -489,9 +489,9 @@ void io_shutdown_zcrx_ifqs(struct io_ring_ctx *ctx)
489489
{
490490
lockdep_assert_held(&ctx->uring_lock);
491491

492-
if (ctx->ifq)
493-
io_zcrx_scrub(ctx->ifq);
494-
492+
if (!ctx->ifq)
493+
return;
494+
io_zcrx_scrub(ctx->ifq);
495495
io_close_queue(ctx->ifq);
496496
}
497497

0 commit comments

Comments
 (0)