nvmet-file: clamp-down file namespace lba_shift
authorSagi Grimberg <sagi@grimberg.me>
Wed, 24 Apr 2019 18:43:23 +0000 (11:43 -0700)
committerChristoph Hellwig <hch@lst.de>
Thu, 25 Apr 2019 14:51:19 +0000 (16:51 +0200)
commit525ec495e021068aa8635a0e18ff60695f5b1f4f
tree3d18692f443f67dfe4aeef38f5d3608b2a28f92e
parenta5dffbb66d250a7ef07e27a2e75b8d9d7af2ab41
nvmet-file: clamp-down file namespace lba_shift

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. Instead, expose the minimum between i_blkbits and
12 (4K sector size).

Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by:- Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Signed-off-by: Christoph Hellwig <hch@lst.de>
drivers/nvme/target/io-cmd-file.c