[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <aJzwO9dYeBQAHnCC@kbusch-mbp>
Date: Wed, 13 Aug 2025 14:06:19 -0600
From: Keith Busch <kbusch@...nel.org>
To: Keith Busch <kbusch@...a.com>
Cc: linux-block@...r.kernel.org, linux-fsdevel@...r.kernel.org,
linux-kernel@...r.kernel.org, snitzer@...nel.org, axboe@...nel.dk,
dw@...idwei.uk, brauner@...nel.org, Hannes Reinecke <hare@...e.de>
Subject: Re: [PATCHv2 1/7] block: check for valid bio while splitting
On Tue, Aug 05, 2025 at 07:11:17AM -0700, Keith Busch wrote:
> bio_for_each_bvec(bv, bio, iter) {
> + if (bv.bv_offset & lim->dma_alignment)
> + return -EINVAL;
I have a question about this part here because testing with various scsi
is showing odd results.
NVMe wants this check to actually be this:
if ((bv.bv_offset | bv.bv_len) & lim->dma_alignment)
because the dma alignment defines not only the starting address offset,
but also the length. NVMe's default alignment is 4 bytes.
But I can't make that change because many scsi devices don't set the dma
alignment and get the default 511 value. This is fine for the memory
address offset, but the lengths sent for various inquriy commands are
much smaller, like 4 and 32 byte lengths. That length wouldn't pass the
dma alignment granularity, so I think the default value is far too
conservative. Does the address start size need to be a different limit
than minimum length? I feel like they should be the same, but maybe
that's just an nvme thing.
Powered by blists - more mailing lists