nvmet: lift blocksize restriction to 64k
Subsystems (2)
PATCH v2 1/1 nvmet: lift blocksize restriction to 64k
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.
--- drivers/nvme/target/io-cmd-file.c | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
drivers/nvme/target/io-cmd-file.c +2 -3
@@ -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);
Signature · 1 line
2.43.0
Christoph Hellwig
maintainerQuoted 3 lines · Hannes Reinecke
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.
Quoted 9 lines · Christoph Hellwig
Quoted 3 lines · Hannes Reinecke
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
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +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
Christoph Hellwig
maintainerQuoted 6 lines · Hannes Reinecke
Quoted 5 lines · Christoph Hellwig
Quoted 3 lines · Hannes Reinecke
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.
Quoted 7 lines
Quoted 4 lines
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.
Quoted 11 lines · Christoph Hellwig
Quoted 10 lines · Hannes Reinecke
Quoted 9 lines · Christoph Hellwig
Quoted 3 lines · Hannes Reinecke
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.
Quoted 8 lines
Quoted 3 lines
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_blkbitsthat 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
Signature · 4 lines
Dr. Hannes Reinecke Kernel Storage Architect [email protected] +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