Skip to content

Commit e0392a1

Browse files
committed
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: 751eedc ("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>
1 parent 70eafc7 commit e0392a1

1 file changed

Lines changed: 3 additions & 3 deletions

File tree

io_uring/io-wq.c

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -952,11 +952,11 @@ static bool io_wq_for_each_worker(struct io_wq *wq,
952952
void *data)
953953
{
954954
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;
957957
}
958958

959-
return true;
959+
return false;
960960
}
961961

962962
static bool io_wq_worker_wake(struct io_worker *worker, void *data)

0 commit comments

Comments
 (0)