]> Gentwo Git Trees - linux/.git/commit
io_uring: include dying ring in task_work "should cancel" state
authorJens Axboe <axboe@kernel.dk>
Thu, 18 Sep 2025 16:21:14 +0000 (10:21 -0600)
committerJens Axboe <axboe@kernel.dk>
Thu, 18 Sep 2025 16:24:50 +0000 (10:24 -0600)
commit3539b1467e94336d5854ebf976d9627bfb65d6c3
treea6bbcfb9ea4bea836fcfb2a66e94fe0f7f64413b
parentcd4ea81be3eb94047ad023c631afd9bd6c295400
io_uring: include dying ring in task_work "should cancel" state

When running task_work for an exiting task, rather than perform the
issue retry attempt, the task_work is canceled. However, this isn't
done for a ring that has been closed. This can lead to requests being
successfully completed post the ring being closed, which is somewhat
confusing and surprising to an application.

Rather than just check the task exit state, also include the ring
ref state in deciding whether or not to terminate a given request when
run from task_work.

Cc: stable@vger.kernel.org # 6.1+
Link: https://github.com/axboe/liburing/discussions/1459
Reported-by: Benedek Thaler <thaler@thaler.hu>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/io_uring.c
io_uring/io_uring.h
io_uring/poll.c
io_uring/timeout.c
io_uring/uring_cmd.c