From 816095894c0f44aaba4372d92c874121af687596 Mon Sep 17 00:00:00 2001 From: Jens Axboe Date: Fri, 23 Jan 2026 13:58:03 -0700 Subject: [PATCH] io_uring/io-wq: handle !sysctl_hung_task_timeout_secs If the hung_task_timeout sysctl is set to 0, then we'll end up busy looping inside io_wq_exit_workers() after an earlier commit switched to using wait_for_completion_timeout(). Use the maximum schedule timeout value for that case. Fixes: 1f293098a313 ("io_uring/io-wq: don't trigger hung task for syzbot craziness") Reported-by: Chris Mason Signed-off-by: Jens Axboe --- io_uring/io-wq.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/io_uring/io-wq.c b/io_uring/io-wq.c index aaf1dfc217636..3b55feb620d9e 100644 --- a/io_uring/io-wq.c +++ b/io_uring/io-wq.c @@ -1340,6 +1340,8 @@ static void io_wq_exit_workers(struct io_wq *wq) * up waiting more than IO_URING_EXIT_WAIT_MAX. */ timeout = sysctl_hung_task_timeout_secs * HZ / 2; + if (!timeout) + timeout = MAX_SCHEDULE_TIMEOUT; warn_timeout = jiffies + IO_URING_EXIT_WAIT_MAX; do { if (wait_for_completion_timeout(&wq->worker_done, timeout)) -- 2.47.3