io_uring: consider ring dead once the ref is marked dying
authorJens Axboe <axboe@kernel.dk>
Fri, 7 Jul 2023 17:20:04 +0000 (11:20 -0600)
committerJens Axboe <axboe@kernel.dk>
Mon, 21 Apr 2025 11:13:28 +0000 (05:13 -0600)
commit442de2e3974b1de19b0f78eafcea5ba049a0a1d3
treeebd97d532145dc9c52114da027cad570b91c8923
parent37448b9de6d5f32948f5b64cfe866fa3d225afc2
io_uring: consider ring dead once the ref is marked dying

For queueing work to io-wq or adding normal task_work, io_uring will
cancel the work items if the task is going away. If the ring is starting
to go through teardown, the ref is marked as dying. Use that as well for
the fallback/cancel mechanism.

For deferred task_work, this is done out-of-line as part of the exit
work handling. Hence it doesn't need any extra checks in the hot path.

Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c