io_uring: fix ->flags races by linked timeouts
authorPavel Begunkov <asml.silence@gmail.com>
Sun, 14 Mar 2021 20:57:08 +0000 (20:57 +0000)
committerJens Axboe <axboe@kernel.dk>
Mon, 15 Mar 2021 15:31:19 +0000 (09:31 -0600)
commitefe814a471e0e58f28f1efaf430c8784a4f36626
treedfb06e1ac8485fefb8a1d08bb3293894597dce2b
parent9e15c3a0ced5a61f320b989072c24983cb1620c1
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>
fs/io_uring.c