From: Pavel Begunkov Date: Fri, 1 Dec 2023 00:38:52 +0000 (+0000) Subject: io_uring: don't check iopoll if request completes X-Git-Tag: v6.6.14~195 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=2c487fbf22303cf6f21e59659bccc0ce0ff0ca41;p=platform%2Fkernel%2Flinux-starfive.git 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: Signed-off-by: Pavel Begunkov Link: https://lore.kernel.org/r/2f8690e2fa5213a2ff292fac29a7143c036cdd60.1701390926.git.asml.silence@gmail.com Signed-off-by: Jens Axboe Signed-off-by: Greg Kroah-Hartman --- diff --git a/io_uring/io_uring.c b/io_uring/io_uring.c index 586ac65..b406cc6 100644 --- a/io_uring/io_uring.c +++ b/io_uring/io_uring.c @@ -1891,7 +1891,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 */