Skip to content

Commit

Permalink
io_uring: don't clear REQ_F_LINK_TIMEOUT
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Pavel Begunkov authored and Jens Axboe committed Apr 11, 2021
1 parent c15b79d commit d4729fb
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions fs/io_uring.c
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down

0 comments on commit d4729fb

Please sign in to comment.