aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2020-05-01 17:09:37 +0300
committerJens Axboe <axboe@kernel.dk>2020-05-01 08:50:30 -0600
commit4ee3631451c9a62e6b6bc7ee51fb9a5b34e33509 (patch)
tree240096f00b0440988e2e5a83802d9b98f9497986
parent7759a0bfadceef3910d0e50f86d63b6ed58b4e70 (diff)
downloadprintk-4ee3631451c9a62e6b6bc7ee51fb9a5b34e33509.tar.gz
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 <asml.silence@gmail.com> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--fs/io_uring.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 7f10af02c3d144..91ddc27b5173c9 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -5031,7 +5031,7 @@ static int io_req_defer(struct io_kiocb *req, const struct io_uring_sqe *sqe)
int ret;
/* Still need defer if there is pending req in defer list. */
- if (!req_need_defer(req) && list_empty(&ctx->defer_list))
+ if (!req_need_defer(req) && list_empty_careful(&ctx->defer_list))
return 0;
if (!req->io && io_alloc_async_ctx(req))