]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nvme: remove the 0 lba_shift check in nvme_update_ns_info
authorChristoph Hellwig <hch@lst.de>
Mon, 28 Sep 2020 10:12:02 +0000 (12:12 +0200)
committerChristoph Hellwig <hch@lst.de>
Wed, 7 Oct 2020 05:56:18 +0000 (07:56 +0200)
We can no longer reach this code if Identify Namespace failed.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Keith Busch <kbusch@kernel.org>
Reviewed-by: Sagi Grimberg <sagi@grimberg.me>
Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>
Reviewed-by: Damien Le Moal <damien.lemoal@wdc.com>
drivers/nvme/host/core.c

index 0114fe47de3571fbbb91889039d21dfe94fa5370..910198c3e0bbd13b0d6a7df4aebec5eab5e93fec 100644 (file)
@@ -2129,13 +2129,7 @@ static int nvme_update_ns_info(struct nvme_ns *ns, struct nvme_id_ns *id)
        int ret;
 
        blk_mq_freeze_queue(ns->disk->queue);
-       /*
-        * If identify namespace failed, use default 512 byte block size so
-        * block layer can use before failing read/write for 0 capacity.
-        */
        ns->lba_shift = id->lbaf[lbaf].ds;
-       if (ns->lba_shift == 0)
-               ns->lba_shift = 9;
 
        switch (ns->head->ids.csi) {
        case NVME_CSI_NVM: