summaryrefslogtreecommitdiff
path: root/fs/io_uring.c
diff options
context:
space:
mode:
authorPavel Begunkov <asml.silence@gmail.com>2021-03-22 01:58:24 +0000
committerJens Axboe <axboe@kernel.dk>2021-04-11 17:41:59 -0600
commitd4729fbde7665e81f4345e04e2ca86c0b52994d3 (patch)
tree4cc78f2b12780e19f41fe11ac15520f7a6e0fe02 /fs/io_uring.c
parentc15b79dee51bd73d56fe526a779e8fbc02b09e6c (diff)
downloadlwn-d4729fbde7665e81f4345e04e2ca86c0b52994d3.tar.gz
lwn-d4729fbde7665e81f4345e04e2ca86c0b52994d3.zip
io_uring: don't clear REQ_F_LINK_TIMEOUT
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>
Diffstat (limited to 'fs/io_uring.c')
-rw-r--r--fs/io_uring.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c
index 7a6b2b313328..a152c0fd24cc 100644
--- a/fs/io_uring.c
+++ b/fs/io_uring.c
@@ -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)