]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
lightnvm: do no update csecs and sos on 1.2
authorJavier González <javier@javigon.com>
Tue, 9 Oct 2018 11:12:12 +0000 (13:12 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 24 Nov 2019 07:20:51 +0000 (08:20 +0100)
[ Upstream commit 6fd05cad5ee1290b276dd8ed90a1e019b1fa577a ]

1.2 devices exposes their data and metadata size through the separate
identify command. Make sure that the NVMe LBA format does not override
these values.

Signed-off-by: Javier González <javier@cnexlabs.com>
Signed-off-by: Matias Bjørling <mb@lightnvm.io>
Signed-off-by: Jens Axboe <axboe@kernel.dk>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/nvme/host/lightnvm.c

index 6fe5923c95d4aa1f553c76890e84ffd243b6dcdf..a69553e75f38e0f4eecdee734d6e72c0f8327819 100644 (file)
@@ -968,6 +968,9 @@ void nvme_nvm_update_nvm_info(struct nvme_ns *ns)
        struct nvm_dev *ndev = ns->ndev;
        struct nvm_geo *geo = &ndev->geo;
 
+       if (geo->version == NVM_OCSSD_SPEC_12)
+               return;
+
        geo->csecs = 1 << ns->lba_shift;
        geo->sos = ns->ms;
 }