summaryrefslogtreecommitdiff
path: root/io_uring/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-09-12 15:02:48 +0100
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-09-19 12:20:23 +0200
commit208858d4b08aa6103a061bc2923b371b8eac722e (patch)
treeb77d440f95a5f1c2bb0b520a933debbbecdd96a4 /io_uring/io_uring.c
parent6ffab754d2209d2f7e513b3db11a489e6d9dc043 (diff)
downloadlinux-208858d4b08aa6103a061bc2923b371b8eac722e.tar.gz
linux-208858d4b08aa6103a061bc2923b371b8eac722e.tar.bz2
linux-208858d4b08aa6103a061bc2923b371b8eac722e.zip
io_uring: always lock in io_apoll_task_func
From: Dylan Yudaken <dylany@meta.com> [ upstream commit c06c6c5d276707e04cedbcc55625e984922118aa ] This is required for the failure case (io_req_complete_failed) and is missing. The alternative would be to only lock in the failure path, however all of the non-error paths in io_poll_check_events that do not do not return IOU_POLL_NO_ACTION end up locking anyway. The only extraneous lock would be for the multishot poll overflowing the CQE ring, however multishot poll would probably benefit from being locked as it will allow completions to be batched. So it seems reasonable to lock always. Signed-off-by: Dylan Yudaken <dylany@meta.com> Link: https://lore.kernel.org/r/20221124093559.3780686-3-dylany@meta.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring/io_uring.c')
-rw-r--r--io_uring/io_uring.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index dec8a6355f2a..ca484c4012b5 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -5571,6 +5571,7 @@ static void io_apoll_task_func(struct io_kiocb *req, bool *locked)
if (ret > 0)
return;
+ io_tw_lock(req->ctx, locked);
io_poll_remove_entries(req);
spin_lock(&ctx->completion_lock);
hash_del(&req->hash_node);