io_uring: don't take ctx refs in tctx_task_work()
authorPavel Begunkov <asml.silence@gmail.com>
Thu, 21 Apr 2022 13:44:17 +0000 (14:44 +0100)
committerJens Axboe <axboe@kernel.dk>
Thu, 21 Apr 2022 14:38:15 +0000 (08:38 -0600)
commited6187ea3c89408dd0aa7a964284101308435366
tree0674b12a0c915f65a22f46931f21f995596f0b39
parent47ffe5548341cc456aa46953fc92a525c39385fc
io_uring: don't take ctx refs in tctx_task_work()

Now we ban any new req-task_works to be added after we start the task
cancellation. Because tctx is removed from ctx lists only during
task cancellation, and considering that it's removed from the task
context, we'll have current accounted in all rings tctx_task_work() is
working with and so they will stay alive at least awhile it's running.
Don't takes extra ctx refs.

Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/92eb2d1f934ad16752cc3b764d8be75ca04d1ffe.1650548192.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
fs/io_uring.c