* [PATCHv2] nvmet: lift blocksize restriction to 64k
@ 2026-02-20 15:12 Hannes Reinecke
2026-02-20 15:32 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Reinecke @ 2026-02-20 15:12 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Keith Busch, Sagi Grimberg, linux-nvme, Hannes Reinecke,
Abdulla Nasirli
With commit 47dd67532303 ("block/bdev: lift block size restrictions to 64k")
we can now support up to 64k block sizes, so lift the restriction on 4k for
file-backed namespaces.
Reported-by: Abdulla Nasirli <nasirabd@fit.cvut.cz>
Fixes: 47dd67532303 ("block/bdev: lift block size restrictions to 64k")
Signed-off-by: Hannes Reinecke <hare@kernel.org>
---
drivers/nvme/target/io-cmd-file.c | 5 ++---
1 file changed, 2 insertions(+), 3 deletions(-)
diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 2d068439b129..fdc15c59632f 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -50,11 +50,10 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)
nvmet_file_ns_revalidate(ns);
/*
- * i_blkbits can be greater than the universally accepted upper bound,
- * so make sure we export a sane namespace lba_shift.
+ * We can support blocksizes up to 64k.
*/
ns->blksize_shift = min_t(u8,
- file_inode(ns->file)->i_blkbits, 12);
+ file_inode(ns->file)->i_blkbits, ilog2(SZ_64K));
ns->bvec_pool = mempool_create(NVMET_MIN_MPOOL_OBJ, mempool_alloc_slab,
mempool_free_slab, nvmet_bvec_cache);
--
2.43.0
^ permalink raw reply related [flat|nested] 5+ messages in thread
* Re: [PATCHv2] nvmet: lift blocksize restriction to 64k
2026-02-20 15:12 [PATCHv2] nvmet: lift blocksize restriction to 64k Hannes Reinecke
@ 2026-02-20 15:32 ` Christoph Hellwig
2026-02-20 16:42 ` Hannes Reinecke
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2026-02-20 15:32 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Christoph Hellwig, Keith Busch, Sagi Grimberg, linux-nvme,
Abdulla Nasirli
On Fri, Feb 20, 2026 at 04:12:59PM +0100, Hannes Reinecke wrote:
> With commit 47dd67532303 ("block/bdev: lift block size restrictions to 64k")
> we can now support up to 64k block sizes, so lift the restriction on 4k for
> file-backed namespaces.
Still not sure this is a great idea by default. Yes, modern Linux supports
64k sector sizes, but even then just for a few file systems. And this
changes existing setups, which will now break when upgrading the kernel.
This needs an opt-in.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2] nvmet: lift blocksize restriction to 64k
2026-02-20 15:32 ` Christoph Hellwig
@ 2026-02-20 16:42 ` Hannes Reinecke
2026-02-20 16:45 ` Christoph Hellwig
0 siblings, 1 reply; 5+ messages in thread
From: Hannes Reinecke @ 2026-02-20 16:42 UTC (permalink / raw)
To: Christoph Hellwig, Hannes Reinecke
Cc: Keith Busch, Sagi Grimberg, linux-nvme, Abdulla Nasirli
On 2/20/26 16:32, Christoph Hellwig wrote:
> On Fri, Feb 20, 2026 at 04:12:59PM +0100, Hannes Reinecke wrote:
>> With commit 47dd67532303 ("block/bdev: lift block size restrictions to 64k")
>> we can now support up to 64k block sizes, so lift the restriction on 4k for
>> file-backed namespaces.
>
> Still not sure this is a great idea by default. Yes, modern Linux supports
> 64k sector sizes, but even then just for a few file systems. And this
> changes existing setups, which will now break when upgrading the kernel.
>
How so? There cannot be any existing nvmet setup with an LBS backing
device, as the device will be rejected when trying to setup the target.
Which breakage do you see here?
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2] nvmet: lift blocksize restriction to 64k
2026-02-20 16:42 ` Hannes Reinecke
@ 2026-02-20 16:45 ` Christoph Hellwig
2026-02-23 7:44 ` Hannes Reinecke
0 siblings, 1 reply; 5+ messages in thread
From: Christoph Hellwig @ 2026-02-20 16:45 UTC (permalink / raw)
To: Hannes Reinecke
Cc: Christoph Hellwig, Hannes Reinecke, Keith Busch, Sagi Grimberg,
linux-nvme, Abdulla Nasirli
On Fri, Feb 20, 2026 at 05:42:25PM +0100, Hannes Reinecke wrote:
> On 2/20/26 16:32, Christoph Hellwig wrote:
>> On Fri, Feb 20, 2026 at 04:12:59PM +0100, Hannes Reinecke wrote:
>>> With commit 47dd67532303 ("block/bdev: lift block size restrictions to 64k")
>>> we can now support up to 64k block sizes, so lift the restriction on 4k for
>>> file-backed namespaces.
>>
>> Still not sure this is a great idea by default. Yes, modern Linux supports
>> 64k sector sizes, but even then just for a few file systems. And this
>> changes existing setups, which will now break when upgrading the kernel.
>>
> How so? There cannot be any existing nvmet setup with an LBS backing
> device, as the device will be rejected when trying to setup the target.
> Which breakage do you see here?
There can be a setup with a large i_blkbits that we limit to 4k
export LBA size right now, and with your patch it will be exposed
as something larger.
^ permalink raw reply [flat|nested] 5+ messages in thread
* Re: [PATCHv2] nvmet: lift blocksize restriction to 64k
2026-02-20 16:45 ` Christoph Hellwig
@ 2026-02-23 7:44 ` Hannes Reinecke
0 siblings, 0 replies; 5+ messages in thread
From: Hannes Reinecke @ 2026-02-23 7:44 UTC (permalink / raw)
To: Christoph Hellwig
Cc: Hannes Reinecke, Keith Busch, Sagi Grimberg, linux-nvme,
Abdulla Nasirli
On 2/20/26 17:45, Christoph Hellwig wrote:
> On Fri, Feb 20, 2026 at 05:42:25PM +0100, Hannes Reinecke wrote:
>> On 2/20/26 16:32, Christoph Hellwig wrote:
>>> On Fri, Feb 20, 2026 at 04:12:59PM +0100, Hannes Reinecke wrote:
>>>> With commit 47dd67532303 ("block/bdev: lift block size restrictions to 64k")
>>>> we can now support up to 64k block sizes, so lift the restriction on 4k for
>>>> file-backed namespaces.
>>>
>>> Still not sure this is a great idea by default. Yes, modern Linux supports
>>> 64k sector sizes, but even then just for a few file systems. And this
>>> changes existing setups, which will now break when upgrading the kernel.
>>>
>> How so? There cannot be any existing nvmet setup with an LBS backing
>> device, as the device will be rejected when trying to setup the target.
>> Which breakage do you see here?
>
> There can be a setup with a large i_blkbits that we limit to 4k
> export LBA size right now, and with your patch it will be exposed
> as something larger.
>
True.
Hmm. Okay, I'll work on something.
Cheers,
Hannes
--
Dr. Hannes Reinecke Kernel Storage Architect
hare@suse.de +49 911 74053 688
SUSE Software Solutions GmbH, Frankenstr. 146, 90461 Nürnberg
HRB 36809 (AG Nürnberg), GF: I. Totev, A. McDonald, W. Knoblich
^ permalink raw reply [flat|nested] 5+ messages in thread
end of thread, other threads:[~2026-02-23 7:45 UTC | newest]
Thread overview: 5+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-20 15:12 [PATCHv2] nvmet: lift blocksize restriction to 64k Hannes Reinecke
2026-02-20 15:32 ` Christoph Hellwig
2026-02-20 16:42 ` Hannes Reinecke
2026-02-20 16:45 ` Christoph Hellwig
2026-02-23 7:44 ` Hannes Reinecke
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox