io_uring: don't set COMP_LOCKED if won't put
authorPavel Begunkov <asml.silence@gmail.com>
Tue, 13 Oct 2020 08:43:56 +0000 (09:43 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 15 Oct 2020 17:50:08 +0000 (11:50 -0600)
commit7efa6ebf5671f1be234b5014f5d3dabc3e57ebae
tree31834aca78914f0468528a9f2a17c5f44c56e804
parent67284d69ce7e6c34664450fe8745bf8ac0b69ebf
io_uring: don't set COMP_LOCKED if won't put

__io_kill_linked_timeout() sets REQ_F_COMP_LOCKED for a linked timeout
even if it can't cancel it, e.g. it's already running. It not only races
with io_link_timeout_fn() for ->flags field, but also leaves the flag
set and so io_link_timeout_fn() may find it and decide that it holds the
lock. Hopefully, the second problem is potential.

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