summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorKeith Busch <kbusch@kernel.org>2020-04-09 18:09:05 +0200
committerJens Axboe <axboe@kernel.dk>2020-05-10 00:18:35 +0200
commitb2b2de7c5a0127882848f9c5e9379e84d2e02041 (patch)
tree6c2dce22cef3a900ad4431f434508708994a606e
parentnvme-multipath: set bdi capabilities once (diff)
downloadlinux-b2b2de7c5a0127882848f9c5e9379e84d2e02041.tar.xz
linux-b2b2de7c5a0127882848f9c5e9379e84d2e02041.zip
nvme: revalidate after verifying identifiers
If the namespace identifiers have changed, skip updating the disk information, as that will register parameters from a mismatched namespace. Signed-off-by: Keith Busch <kbusch@kernel.org> Reviewed-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/nvme/host/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 0624393d95e2..b9e6e6de58cf 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -1936,7 +1936,6 @@ static int nvme_revalidate_disk(struct gendisk *disk)
goto free_id;
}
- __nvme_revalidate_disk(disk, id);
ret = nvme_report_ns_ids(ctrl, ns->head->ns_id, id, &ids);
if (ret)
goto free_id;
@@ -1945,8 +1944,10 @@ static int nvme_revalidate_disk(struct gendisk *disk)
dev_err(ctrl->device,
"identifiers changed for nsid %d\n", ns->head->ns_id);
ret = -ENODEV;
+ goto free_id;
}
+ __nvme_revalidate_disk(disk, id);
free_id:
kfree(id);
out: