Skip to content

Commit

Permalink
io_uring: don't check iopoll if request completes
Browse files Browse the repository at this point in the history
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:  <[email protected]>
Signed-off-by: Pavel Begunkov <[email protected]>
Link: https://lore.kernel.org/r/2f8690e2fa5213a2ff292fac29a7143c036cdd60.1701390926.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
isilence authored and axboe committed Dec 12, 2023
1 parent 2394b31 commit 9b43ef3
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion io_uring/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 9b43ef3

Please sign in to comment.