Skip to content

Commit 6a3a747

Browse files
isilencedinguyen702
authored andcommitted
io_uring: fail links when poll fails
[ upstream commmit c487a5a ] 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]> [pavel: backport] Signed-off-by: Pavel Begunkov <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]>
1 parent 26c82ec commit 6a3a747

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

fs/io_uring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -5844,6 +5844,8 @@ static int io_poll_add(struct io_kiocb *req, unsigned int issue_flags)
58445844
ipt.pt._qproc = io_poll_queue_proc;
58455845

58465846
ret = __io_arm_poll_handler(req, &req->poll, &ipt, poll->events);
5847+
if (!ret && ipt.error)
5848+
req_set_fail(req);
58475849
ret = ret ?: ipt.error;
58485850
if (ret)
58495851
__io_req_complete(req, issue_flags, ret, 0);

0 commit comments

Comments
 (0)