public inbox for [email protected]
 help / color / mirror / Atom feed
From: Pavel Begunkov <[email protected]>
To: Jens Axboe <[email protected]>, [email protected]
Subject: [PATCH 3/4] io_uring: always clear LINK_TIMEOUT after cancel
Date: Thu, 22 Oct 2020 16:43:10 +0100	[thread overview]
Message-ID: <a671c1f0204747d226e284d31a9335449e71e0cb.1603381140.git.asml.silence@gmail.com> (raw)
In-Reply-To: <[email protected]>

Move REQ_F_LINK_TIMEOUT clearing out of __io_kill_linked_timeout()
because it might return early and leave the flag set. It's not a
problem, but may be confusing.

Signed-off-by: Pavel Begunkov <[email protected]>
---
 fs/io_uring.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/io_uring.c b/fs/io_uring.c
index 5e327d620b8f..d9ac45f850be 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -1881,7 +1881,6 @@ static bool __io_kill_linked_timeout(struct io_kiocb *req)
 
 	list_del_init(&link->link_list);
 	wake_ev = io_link_cancel_timeout(link);
-	req->flags &= ~REQ_F_LINK_TIMEOUT;
 	return wake_ev;
 }
 
@@ -1893,6 +1892,7 @@ static void io_kill_linked_timeout(struct io_kiocb *req)
 
 	spin_lock_irqsave(&ctx->completion_lock, flags);
 	wake_ev = __io_kill_linked_timeout(req);
+	req->flags &= ~REQ_F_LINK_TIMEOUT;
 	spin_unlock_irqrestore(&ctx->completion_lock, flags);
 
 	if (wake_ev)
-- 
2.24.0


  parent reply	other threads:[~2020-10-22 15:46 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-10-22 15:43 [PATCH 0/4] clean up linked timeouts Pavel Begunkov
2020-10-22 15:43 ` [PATCH 1/4] io_uring: remove opcode check on ltimeout kill Pavel Begunkov
2020-10-22 15:43 ` [PATCH 2/4] io_uring: dont adjust LINK_HEAD in cancel ltimeout Pavel Begunkov
2020-10-22 15:43 ` Pavel Begunkov [this message]
2020-10-22 15:43 ` [PATCH 4/4] io_uring: don't defer put of cancelled ltimeout Pavel Begunkov

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:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

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

  git send-email \
    --in-reply-to=a671c1f0204747d226e284d31a9335449e71e0cb.1603381140.git.asml.silence@gmail.com \
    [email protected] \
    [email protected] \
    [email protected] \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* 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