Skip to content

Commit 4ee3631

Browse files
isilenceaxboe
authored andcommitted
io_uring: check non-sync defer_list carefully
io_req_defer() do double-checked locking. Use proper helpers for that, i.e. list_empty_careful(). Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Jens Axboe <[email protected]>
1 parent 7759a0b commit 4ee3631

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

fs/io_uring.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5031,7 +5031,7 @@ static int io_req_defer(struct io_kiocb *req, const struct io_uring_sqe *sqe)
50315031
int ret;
50325032

50335033
/* Still need defer if there is pending req in defer list. */
5034-
if (!req_need_defer(req) && list_empty(&ctx->defer_list))
5034+
if (!req_need_defer(req) && list_empty_careful(&ctx->defer_list))
50355035
return 0;
50365036

50375037
if (!req->io && io_alloc_async_ctx(req))

0 commit comments

Comments
 (0)