[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <883afab8-336a-434a-b64d-13a5db7c0f24@kernel.dk>
Date: Wed, 2 Jul 2025 07:47:50 -0600
From: Jens Axboe <axboe@...nel.dk>
To: Ammar Faizi <ammarfaizi2@...weeb.org>, Daniel Vacek <neelx@...e.com>
Cc: Caleb Sander Mateos <csander@...estorage.com>, Chris Mason <clm@...com>,
Josef Bacik <josef@...icpanda.com>, David Sterba <dsterba@...e.com>,
Mark Harmstone <maharmstone@...com>,
Linux Btrfs Mailing List <linux-btrfs@...r.kernel.org>,
io-uring Mailing List <io-uring@...r.kernel.org>,
Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH 2/4] io_uring/cmd: introduce IORING_URING_CMD_REISSUE flag
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@...nel.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
Powered by blists - more mailing lists