Skip to content

Commit 9b43ef3

Browse files
isilenceaxboe
authored andcommitted
io_uring: don't check iopoll if request completes
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>
1 parent 2394b31 commit 9b43ef3

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

io_uring/io_uring.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1898,7 +1898,11 @@ static int io_issue_sqe(struct io_kiocb *req, unsigned int issue_flags)
18981898
io_req_complete_defer(req);
18991899
else
19001900
io_req_complete_post(req, issue_flags);
1901-
} else if (ret != IOU_ISSUE_SKIP_COMPLETE)
1901+
1902+
return 0;
1903+
}
1904+
1905+
if (ret != IOU_ISSUE_SKIP_COMPLETE)
19021906
return ret;
19031907

19041908
/* If the op doesn't have a file, we're not polling for it */

0 commit comments

Comments
 (0)