public inbox for linux-nvme@lists.infradead.org
 help / color / mirror / Atom feed
* [PATCH] nvmet: lift blocksize restriction to 64k
@ 2025-12-03 11:30 Hannes Reinecke
  2025-12-04  9:27 ` Christoph Hellwig
  0 siblings, 1 reply; 3+ messages in thread
From: Hannes Reinecke @ 2025-12-03 11:30 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Sagi Grimberg, Keith Busch, 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..1ef4f262594a 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 (= 16 bits).
 	 */
 	ns->blksize_shift = min_t(u8,
-			file_inode(ns->file)->i_blkbits, 12);
+			file_inode(ns->file)->i_blkbits, 16);
 
 	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] 3+ messages in thread

* Re: [PATCH] nvmet: lift blocksize restriction to 64k
  2025-12-03 11:30 [PATCH] nvmet: lift blocksize restriction to 64k Hannes Reinecke
@ 2025-12-04  9:27 ` Christoph Hellwig
  2025-12-12 13:44   ` Sagi Grimberg
  0 siblings, 1 reply; 3+ messages in thread
From: Christoph Hellwig @ 2025-12-04  9:27 UTC (permalink / raw)
  To: Hannes Reinecke
  Cc: Christoph Hellwig, Sagi Grimberg, Keith Busch, linux-nvme,
	Abdulla Nasirli

On Wed, Dec 03, 2025 at 12:30:00PM +0100, Hannes Reinecke wrote:
> -			file_inode(ns->file)->i_blkbits, 12);
> +			file_inode(ns->file)->i_blkbits, 16);

Make that ilog(SZ_64K) instead of the magic number shift?

Otherwise looks good.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH] nvmet: lift blocksize restriction to 64k
  2025-12-04  9:27 ` Christoph Hellwig
@ 2025-12-12 13:44   ` Sagi Grimberg
  0 siblings, 0 replies; 3+ messages in thread
From: Sagi Grimberg @ 2025-12-12 13:44 UTC (permalink / raw)
  To: Christoph Hellwig, Hannes Reinecke
  Cc: Keith Busch, linux-nvme, Abdulla Nasirli



On 04/12/2025 11:27, Christoph Hellwig wrote:
> On Wed, Dec 03, 2025 at 12:30:00PM +0100, Hannes Reinecke wrote:
>> -			file_inode(ns->file)->i_blkbits, 12);
>> +			file_inode(ns->file)->i_blkbits, 16);
> Make that ilog(SZ_64K) instead of the magic number shift?
>
> Otherwise looks good.
>
  lgtm with hch suggestio

Reviewed-by: Sagi Grimberg <sagi@grimberg.me>


^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2025-12-12 13:44 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-12-03 11:30 [PATCH] nvmet: lift blocksize restriction to 64k Hannes Reinecke
2025-12-04  9:27 ` Christoph Hellwig
2025-12-12 13:44   ` Sagi Grimberg

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox