diff options
author | Pavel Begunkov <asml.silence@gmail.com> | 2021-03-14 20:57:08 +0000 |
---|---|---|
committer | Jens Axboe <axboe@kernel.dk> | 2021-03-15 09:31:19 -0600 |
commit | efe814a471e0e58f28f1efaf430c8784a4f36626 (patch) | |
tree | dfb06e1ac8485fefb8a1d08bb3293894597dce2b /fs | |
parent | 9e15c3a0ced5a61f320b989072c24983cb1620c1 (diff) |
io_uring: fix ->flags races by linked timeouts
It's racy to modify req->flags from a not owning context, e.g. linked
timeout calling req_set_fail_links() for the master request might race
with that request setting/clearing flags while being executed
concurrently. Just remove req_set_fail_links(prev) from
io_link_timeout_fn(), io_async_find_and_cancel() and functions down the
line take care of setting the fail bit.
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs')
-rw-r--r-- | fs/io_uring.c | 1 |
1 files changed, 0 insertions, 1 deletions
diff --git a/fs/io_uring.c b/fs/io_uring.c index 58d62dd9f8e4..217f72d50ff5 100644 --- a/fs/io_uring.c +++ b/fs/io_uring.c @@ -6197,7 +6197,6 @@ static enum hrtimer_restart io_link_timeout_fn(struct hrtimer *timer) spin_unlock_irqrestore(&ctx->completion_lock, flags); if (prev) { - req_set_fail_links(prev); io_async_find_and_cancel(ctx, req, prev->user_data, -ETIME); io_put_req_deferred(prev, 1); } else { |