]> www.infradead.org Git - users/hch/misc.git/commit
io_uring/waitid: don't abuse io_tw_state
authorPavel Begunkov <asml.silence@gmail.com>
Wed, 12 Feb 2025 13:33:24 +0000 (13:33 +0000)
committerJens Axboe <axboe@kernel.dk>
Wed, 12 Feb 2025 14:30:50 +0000 (07:30 -0700)
commit06521ac0485effdcc9c792cb0b40ed8e6f2f5fb8
treee4c5d1d7427ef92173e85c249c88498bdf246c05
parent8c8492ca64e79c6e0f433e8c9d2bcbd039ef83d0
io_uring/waitid: don't abuse io_tw_state

struct io_tw_state is managed by core io_uring, and opcode handling code
must never try to cheat and create their own instances, it's plain
incorrect.

io_waitid_complete() attempts exactly that outside of the task work
context, and even though the ring is locked, there would be no one to
reap the requests from the defer completion list. It only works now
because luckily it's called before io_uring_try_cancel_uring_cmd(),
which flushes completions.

Fixes: f31ecf671ddc4 ("io_uring: add IORING_OP_WAITID support")
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/waitid.c