archive mirror
 help / color / mirror / Atom feed
From: Pavel Begunkov <>
To: Jens Axboe <>,
Subject: [PATCH] io_uring: fail links of cancelled timeouts
Date: Thu,  9 Sep 2021 13:56:27 +0100	[thread overview]
Message-ID: <> (raw)

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

Signed-off-by: Pavel Begunkov <>
 fs/io_uring.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index aabc2b489831..e6ccdae189b0 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1486,6 +1486,8 @@ static void io_kill_timeout(struct io_kiocb *req, int status)
 	struct io_timeout_data *io = req->async_data;
 	if (hrtimer_try_to_cancel(&io->timer) != -1) {
+		if (status)
+			req_set_fail(req);
 			atomic_read(&req->ctx->cq_timeouts) + 1);

             reply	other threads:[~2021-09-09 14:24 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-09-09 12:56 Pavel Begunkov [this message]
2021-09-09 15:41 ` [PATCH] io_uring: fail links of cancelled timeouts Jens Axboe

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \ \ \ \ \

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).