All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] nvmet-file: clamp-down file namespace lba_shift
@ 2019-03-05  9:55 Sagi Grimberg
  2019-03-06 20:11 ` Chaitanya Kulkarni
  2019-03-08 13:30 ` Christoph Hellwig
  0 siblings, 2 replies; 7+ messages in thread
From: Sagi Grimberg @ 2019-03-05  9:55 UTC (permalink / raw)


When the backing file is a tempfile for example, the inode i_blkbits
can be 1M in size which causes problems for hosts to support as the
disk block size.

Signed-off-by: Sagi Grimberg <sagi at grimberg.me>
---
This issue was observed in I/O errors in the log running test nvme/009.

 drivers/nvme/target/io-cmd-file.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/nvme/target/io-cmd-file.c b/drivers/nvme/target/io-cmd-file.c
index 517522305e5c..5008826cbd6a 100644
--- a/drivers/nvme/target/io-cmd-file.c
+++ b/drivers/nvme/target/io-cmd-file.c
@@ -49,7 +49,7 @@ int nvmet_file_ns_enable(struct nvmet_ns *ns)
 		goto err;
 
 	ns->size = stat.size;
-	ns->blksize_shift = file_inode(ns->file)->i_blkbits;
+	ns->blksize_shift = min_t(u8, file_inode(ns->file)->i_blkbits, PAGE_SHIFT);
 
 	ns->bvec_cache = kmem_cache_create("nvmet-bvec",
 			NVMET_MAX_MPOOL_BVEC * sizeof(struct bio_vec),
-- 
2.17.1

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

end of thread, other threads:[~2019-03-08 13:30 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-03-05  9:55 [PATCH] nvmet-file: clamp-down file namespace lba_shift Sagi Grimberg
2019-03-06 20:11 ` Chaitanya Kulkarni
2019-03-06 20:19   ` Sagi Grimberg
2019-03-06 20:38     ` Chaitanya Kulkarni
2019-03-06 20:49       ` Keith Busch
2019-03-07  1:14         ` Sagi Grimberg
2019-03-08 13:30 ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.