summaryrefslogtreecommitdiffstats
path: root/io_uring
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2023-12-01 00:38:52 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2024-01-25 15:45:13 -0800
commitd413a342275d0d81ca04563ebc897858a7a5f159 (patch)
tree908d3d920553d62fe23544624010026c1819a285 /io_uring
parent146b8010753de49a0fea8a76dc7beb869bc95824 (diff)
downloadlinux-stable-d413a342275d0d81ca04563ebc897858a7a5f159.tar.gz
linux-stable-d413a342275d0d81ca04563ebc897858a7a5f159.tar.bz2
linux-stable-d413a342275d0d81ca04563ebc897858a7a5f159.zip
io_uring: don't check iopoll if request completes
commit 9b43ef3d52532a0175ed6654618f7db61d390d2e upstream. IOPOLL request should never return IOU_OK, so the following iopoll queueing check in io_issue_sqe() after getting IOU_OK doesn't make any sense as would never turn true. Let's optimise on that and return a bit earlier. It's also much more resilient to potential bugs from mischieving iopoll implementations. Cc: <stable@vger.kernel.org> Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/2f8690e2fa5213a2ff292fac29a7143c036cdd60.1701390926.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'io_uring')
-rw-r--r--io_uring/io_uring.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c
index 9626a363f121..828d0975c270 100644
--- a/io_uring/io_uring.c
+++ b/io_uring/io_uring.c
@@ -1898,7 +1898,11 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
io_req_complete_defer(req);
else
io_req_complete_post(req, issue_flags);
- } else if (ret != IOU_ISSUE_SKIP_COMPLETE)
+
+ return 0;
+ }
+
+ if (ret != IOU_ISSUE_SKIP_COMPLETE)
return ret;
/* If the op doesn't have a file, we're not polling for it */