io_uring: don't clear REQ_F_LINK_TIMEOUT
authorPavel Begunkov <asml.silence@gmail.com>
Mon, 22 Mar 2021 01:58:24 +0000 (01:58 +0000)
committerJens Axboe <axboe@kernel.dk>
Sun, 11 Apr 2021 23:41:59 +0000 (17:41 -0600)
REQ_F_LINK_TIMEOUT is a hint that to look for linked timeouts to cancel,
we're leaving it even when it's already fired. Hence don't care to clear
it in io_kill_linked_timeout(), it's safe and is called only once.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c

index 7a6b2b31332840cbcabda64831cb15d6e98ba0ca..a152c0fd24cc152a8467994dd65b4063be20c965 100644 (file)
@@ -1766,7 +1766,6 @@ static bool io_kill_linked_timeout(struct io_kiocb *req)
        __must_hold(&req->ctx->completion_lock)
 {
        struct io_kiocb *link = req->link;
-       bool cancelled = false;
 
        /*
         * Can happen if a linked timeout fired and link had been like
@@ -1782,11 +1781,10 @@ static bool io_kill_linked_timeout(struct io_kiocb *req)
                if (ret != -1) {
                        io_cqring_fill_event(link, -ECANCELED);
                        io_put_req_deferred(link, 1);
-                       cancelled = true;
+                       return true;
                }
        }
-       req->flags &= ~REQ_F_LINK_TIMEOUT;
-       return cancelled;
+       return false;
 }
 
 static void io_fail_links(struct io_kiocb *req)