public inbox for io-uring@vger.kernel.org
 help / color / mirror / Atom feed
From: Jens Axboe <axboe@kernel.dk>
To: Ammar Faizi <ammarfaizi2@gnuweeb.org>, Daniel Vacek <neelx@suse.com>
Cc: Caleb Sander Mateos <csander@purestorage.com>,
	Chris Mason <clm@fb.com>, Josef Bacik <josef@toxicpanda.com>,
	David Sterba <dsterba@suse.com>,
	Mark Harmstone <maharmstone@fb.com>,
	Linux Btrfs Mailing List <linux-btrfs@vger.kernel.org>,
	io-uring Mailing List <io-uring@vger.kernel.org>,
	Linux Kernel Mailing List <linux-kernel@vger.kernel.org>
Subject: Re: [PATCH 2/4] io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag
Date: Wed, 2 Jul 2025 07:47:50 -0600	[thread overview]
Message-ID: <883afab8-336a-434a-b64d-13a5db7c0f24@kernel.dk> (raw)
In-Reply-To: <33d93770-886f-4337-a922-579e102c0067@gnuweeb.org>

On 7/2/25 12:44 AM, Ammar Faizi wrote:
> On 7/2/25 1:27 PM, Daniel Vacek wrote:
>> On Tue, 1 Jul 2025 at 21:04, Jens Axboe <axboe@kernel.dk> wrote:
>>> Probably fold that under the next statement?
>>>
>>>          if (ret == -EAGAIN || ret == -EIOCBQUEUED) {
>>>                  if (ret == -EAGAIN) {
>>>                          ioucmd->flags |= IORING_URING_CMD_REISSUE;
>>>                  return ret;
>>>          }
>>>
>>> ?
>>
>> I'd argue the original looks simpler, cleaner.
> 
> I propose doing it this way:
> 
>     if (ret == -EAGAIN) {
>         ioucmd->flags |= IORING_URING_CMD_REISSUE;
>         return ret;
>     }
> 
>     if (ret == -EIOCBQUEUED)
>         return ret;
> 
> It's simpler because the -EAGAIN is only checked once :)

Mine was mostly done for code generation reasons, though probably
the compiler is smart enough. I did consider yours as well, it's
more readable. However I'd then write it as:

if (ret == -EAGAIN) {
	ioucmd->flags |= IORING_URING_CMD_REISSUE;
	return -EAGAIN;
} else if (ret == -EIOCBQUEUED) {
	return -EIOCBQUEUED;
}

But we're obviously nitpicking now. The bigger question as posed in
another patch in this series is whether we need IORING_URING_CMD_REISSUE
at all in the first place.

-- 
Jens Axboe

  parent reply	other threads:[~2025-07-02 13:47 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-06-19 19:27 [PATCH 0/4] io_uring/btrfs: remove struct io_uring_cmd_data Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 1/4] btrfs/ioctl: don't skip accounting in early ENOTTY return Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 2/4] io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag Caleb Sander Mateos
2025-07-01 19:03   ` Jens Axboe
2025-07-02  6:27     ` Daniel Vacek
2025-07-02  6:44       ` Ammar Faizi
2025-07-02  7:00         ` Alan Huang
2025-07-02 13:47         ` Jens Axboe [this message]
2025-06-19 19:27 ` [PATCH 3/4] btrfs/ioctl: store btrfs_uring_encoded_data in io_btrfs_cmd Caleb Sander Mateos
2025-07-01 19:05   ` Jens Axboe
2025-07-02 19:51     ` Caleb Sander Mateos
2025-07-08 18:17       ` Jens Axboe
2025-07-08 18:32         ` Caleb Sander Mateos
2025-06-19 19:27 ` [PATCH 4/4] io_uring/cmd: remove struct io_uring_cmd_data Caleb Sander Mateos
2025-06-20 15:47 ` [PATCH 0/4] io_uring/btrfs: " David Sterba
2025-07-01 15:01   ` David Sterba

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=883afab8-336a-434a-b64d-13a5db7c0f24@kernel.dk \
    --to=axboe@kernel.dk \
    --cc=ammarfaizi2@gnuweeb.org \
    --cc=clm@fb.com \
    --cc=csander@purestorage.com \
    --cc=dsterba@suse.com \
    --cc=io-uring@vger.kernel.org \
    --cc=josef@toxicpanda.com \
    --cc=linux-btrfs@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=maharmstone@fb.com \
    --cc=neelx@suse.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