io_uring/sqpoll: early exit thread if task_context wasn't allocated
authorJens Axboe <axboe@kernel.dk>
Tue, 19 Mar 2024 02:22:42 +0000 (20:22 -0600)
committerJens Axboe <axboe@kernel.dk>
Tue, 19 Mar 2024 02:22:42 +0000 (20:22 -0600)
commit1251d2025c3e1bcf1f17ec0f3c0dfae5e5bbb146
tree47be0e27dc797162dab74f10305223ed5a3dee8e
parente21e1c45e1fe2e31732f40256b49c04e76a17cee
io_uring/sqpoll: early exit thread if task_context wasn't allocated

Ideally we'd want to simply kill the task rather than wake it, but for
now let's just add a startup check that causes the thread to exit.
This can only happen if io_uring_alloc_task_context() fails, which
generally requires fault injection.

Reported-by: Ubisectech Sirius <bugreport@ubisectech.com>
Fixes: af5d68f8892f ("io_uring/sqpoll: manage task_work privately")
Signed-off-by: Jens Axboe <axboe@kernel.dk>
io_uring/sqpoll.c