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>
Thu, 21 Jul 2022 14:47:03 +0000 (08:47 -0600)
commit214bf9753e56ebb5f5bd2a76e4b242adbbf7453d
tree65d428330aeb28ba2bf0b40f72ad3d64edac1c10
parent69a7c434f4333aaa65aaf0305d5e12026ad43e99
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