WSL2-Linux-Kernel/io_uring
Pavel Begunkov 5c402f323f io_uring/io-wq: limit retrying worker initialisation
commit 0453aad676ff99787124b9b3af4a5f59fbe808e2 upstream.

If io-wq worker creation fails, we retry it by queueing up a task_work.
tasK_work is needed because it should be done from the user process
context. The problem is that retries are not limited, and if queueing a
task_work is the reason for the failure, we might get into an infinite
loop.

It doesn't seem to happen now but it would with the following patch
executing task_work in the freezer's loop. For now, arbitrarily limit the
number of attempts to create a worker.

Cc: stable@vger.kernel.org
Fixes: 3146cba99a ("io-wq: make worker creation resilient against signals")
Reported-by: Julian Orth <ju.orth@gmail.com>
Signed-off-by: Pavel Begunkov <asml.silence@gmail.com>
Link: https://lore.kernel.org/r/8280436925db88448c7c85c6656edee1a43029ea.1720634146.git.asml.silence@gmail.com
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2024-08-19 05:45:22 +02:00
..
Makefile io_uring: move to separate directory 2022-12-14 11:37:31 +01:00
io-wq.c io_uring/io-wq: limit retrying worker initialisation 2024-08-19 05:45:22 +02:00
io-wq.h io_uring: break out of iowq iopoll on teardown 2023-09-19 12:22:54 +02:00
io_uring.c io_uring: tighten task exit cancellations 2024-08-19 05:45:14 +02:00