[RFC v2 10/11] nvme: remove superfluous block size check

Luis Chamberlain
2024-12-14T03:11:18Z

The block layer already validates proper block sizes with
blk_validate_block_size() for us so we can remove this now
superfluous check.

Reviewed-by: Hannes Reinecke <hare@suse.de>
Signed-off-by: Luis Chamberlain <mcgrof@kernel.org>
---
drivers/nvme/host/core.c | 10 ----------
1 file changed, 10 deletions(-)

diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index d169a30eb935..bbb5e9d2415c 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -2029,16 +2029,6 @@ static bool nvme_update_disk_info(struct nvme_ns *ns, struct nvme_id_ns *id,
u32 atomic_bs, phys_bs, io_opt = 0;
bool valid = true;

- /*
- * The block layer can't support LBA sizes larger than the page size
- * or smaller than a sector size yet, so catch this early and don't
- * allow block I/O.
- */
- if (head->lba_shift > PAGE_SHIFT || head->lba_shift < SECTOR_SHIFT) {
- bs = (1 << 9);
- valid = false;
- }
-
atomic_bs = phys_bs = bs;
if (id->nabo == 0) {
/*
--
2.43.0