Skip to content

Commit 2ae2eb9

Browse files
isilenceaxboe
authored andcommitted
io_uring: fail links of cancelled timeouts
When we cancel a timeout we should mark it with REQ_F_FAIL, so linked requests are cancelled as well, but not queued for further execution. Cc: stable@vger.kernel.org Signed-off-by: Pavel Begunkov <asml.silence@gmail.com> Link: https://lore.kernel.org/r/fff625b44eeced3a5cae79f60e6acf3fbdf8f990.1631192135.git.asml.silence@gmail.com Signed-off-by: Jens Axboe <axboe@kernel.dk>
1 parent 66e70be commit 2ae2eb9

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

fs/io_uring.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1482,6 +1482,8 @@ static void io_kill_timeout(struct io_kiocb *req, int status)
14821482
struct io_timeout_data *io = req->async_data;
14831483

14841484
if (hrtimer_try_to_cancel(&io->timer) != -1) {
1485+
if (status)
1486+
req_set_fail(req);
14851487
atomic_set(&req->ctx->cq_timeouts,
14861488
atomic_read(&req->ctx->cq_timeouts) + 1);
14871489
list_del_init(&req->timeout.list);

0 commit comments

Comments
 (0)