Skip to content

Commit

Permalink
io_uring: fail links when poll fails
Browse files Browse the repository at this point in the history
Don't forget to cancel all linked requests of poll request when
__io_arm_poll_handler() failed.

Fixes: aa43477 ("io_uring: poll rework")
Signed-off-by: Pavel Begunkov <[email protected]>
Link: https://lore.kernel.org/r/a78aad962460f9fdfe4aa4c0b62425c88f9415bc.1655852245.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <[email protected]>
  • Loading branch information
isilence authored and axboe committed Jun 21, 2022
1 parent aacf2f9 commit c487a5a
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -7405,6 +7405,8 @@ static int io_poll_add(struct io_kiocb *req, unsigned int issue_flags)
ipt.pt._qproc = io_poll_queue_proc;

ret = __io_arm_poll_handler(req, &req->poll, &ipt, poll->events);
if (!ret && ipt.error)
req_set_fail(req);
ret = ret ?: ipt.error;
if (ret)
__io_req_complete(req, issue_flags, ret, 0);
Expand Down

0 comments on commit c487a5a

Please sign in to comment.