Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

io_uring/io-wq: fix incorrect io_wq_for_each_worker() termination logic

A previous commit added this helper, and had it terminate if false is
returned from the handler. However, that is completely opposite, it
should abort the loop if true is returned.

Fix this up by having io_wq_for_each_worker() keep iterating as long
as false is returned, and only abort if true is returned.

Cc: stable@vger.kernel.org
Fixes: 751eedc4b4b7 ("io_uring/io-wq: move worker lists to struct io_wq_acct")
Reported-by: Lewis Campbell <info@lewiscampbell.tech>
Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>
Signed-off-by: Jens Axboe <axboe@kernel.dk>

+3 -3
+3 -3
io_uring/io-wq.c
··· 952 952 void *data) 953 953 { 954 954 for (int i = 0; i < IO_WQ_ACCT_NR; i++) { 955 - if (!io_acct_for_each_worker(&wq->acct[i], func, data)) 956 - return false; 955 + if (io_acct_for_each_worker(&wq->acct[i], func, data)) 956 + return true; 957 957 } 958 958 959 - return true; 959 + return false; 960 960 } 961 961 962 962 static bool io_wq_worker_wake(struct io_worker *worker, void *data)