io_uring: don't race double poll setting REQ_F_ASYNC_DATA
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 7 Jul 2022 14:13:15 +0000 (15:13 +0100)
committerJens Axboe <axboe@kernel.dk>
Mon, 25 Jul 2022 00:39:17 +0000 (18:39 -0600)
commitceff501790a9789c748a9b851f30f4f7e2fe4d72
treea5fdf42fb282f41f465afd44abb0884567c992b1
parent7a121ced6e6430d49fb802067b4f020f6df62362
io_uring: don't race double poll setting REQ_F_ASYNC_DATA

Just as with io_poll_double_prepare() setting REQ_F_DOUBLE_POLL, we can
race with the first poll entry when setting REQ_F_ASYNC_DATA. Move it
under io_poll_double_prepare().

Fixes: a18427bb2d9b ("io_uring: optimise submission side poll_refs")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/df6920f509c11115aa2bce8b34dc5fdb0eb98920.1657203020.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/poll.c