public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Gabriel Krisman Bertazi <krisman@suse.de>
Cc: io-uring <io-uring@vger.kernel.org>,
	Max Kellermann <max.kellermann@ionos.com>
Subject: Re: [PATCH v2] io_uring/io-wq: fix incorrect io_wq_for_each_worker() termination logic
Date: Mon, 5 Jan 2026 11:41:26 -0700	[thread overview]
Message-ID: <53244a6d-75ca-4fa0-90f6-8d2952d85b46@kernel.dk> (raw)
In-Reply-To: <87y0mc6ihs.fsf@mailhost.krisman.be>

On 1/5/26 11:07 AM, Gabriel Krisman Bertazi wrote:
> Jens Axboe <axboe@kernel.dk> writes:
> 
>> 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.
> 
> The fix is good, but the API is just weird.
> 
> io_acct_for_each_worker returning true indicates an error that will
> abort the wq walk.  It is a non-issue, since all the two callers cannot
> fail and always return false for success :-)
> 
> Reviewed-by: Gabriel Krisman Bertazi <krisman@suse.de>

Thanks for taking a look! Was going to post a followup just killing
the return value of io_wq_for_each_worker() to void as nobody uses
it. Only the cancelation side with its matching will use a true
return, most of iterations want to iterate all of them.

-- 
Jens Axboe

  reply	other threads:[~2026-01-05 18:41 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-05 16:57 [PATCH v2] io_uring/io-wq: fix incorrect io_wq_for_each_worker() termination logic Jens Axboe
2026-01-05 18:07 ` Gabriel Krisman Bertazi
2026-01-05 18:41   ` Jens Axboe [this message]
2026-01-05 18:54     ` David Kahurani

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=53244a6d-75ca-4fa0-90f6-8d2952d85b46@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=io-uring@vger.kernel.org \
    --cc=krisman@suse.de \
    --cc=max.kellermann@ionos.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox