[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <8418057.aG60p0z9Xu@anvil>
Date: Fri, 18 Apr 2025 11:56:30 +0200
From: Richard Weinberger <richard@...ma-star.at>
To: linux-nvme@...ts.infradead.org, linux-kernel@...r.kernel.org
Cc: Richard Weinberger <richard@....at>, kch@...dia.com, sagi@...mberg.me,
hch@....de, upstream+nvme@...ma-star.at, Damien Le Moal <dlemoal@...nel.org>
Subject: Re: [RFC PATCH] nvmet: Make blksize_shift configurable
On Freitag, 18. April 2025 11:37 'Damien Le Moal' via upstream wrote:
> > + if (!ns->blksize_shift)
> > + ns->blksize_shift = blksize_bits(bdev_logical_block_size(ns->bdev));
>
> If the user set logical block size is smaller than the block dev logical block
> size, this is not going to work... No ? Am I missing something ?
Likely, yes.
TBH, I'm not sure whether it makes actually sense for the bdev case to make
blksize_shift configurable.
The case I see most benefit is the backing file case.
> > + if (!ns->blksize_shift) {
> > + /*
> > + * i_blkbits can be greater than the universally accepted
> > + * upper bound, so make sure we export a sane namespace
> > + * lba_shift.
> > + */
> > + ns->blksize_shift = min_t(u8,
> > + file_inode(ns->file)->i_blkbits, 12);
>
> This will work for any block size, regardless of the FS block size, but only if
> ns->buffered_io is true. Doesn't this require some more checks with regards to
> O_DIRECT (!ns->buffered_io case) ?
Good catch. I'll add a check.
It's also worth discussing whether we should limit blksize_shift to a specific
range. Right now, any shift is accepted, and it is up to the user to
use a sane value.
Thanks,
//richard
--
sigma star gmbh | Eduard-Bodem-Gasse 6, 6020 Innsbruck, AUT UID/VAT Nr:
ATU 66964118 | FN: 374287y
Powered by blists - more mailing lists