aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-01-09 03:45:15 -0500
committerJens Axboe <axboe@kernel.dk>2019-01-23 19:16:59 -0500
commit78a61cd42a64f3587862b372a79e1d6aaf131fd7 (patch)
treeeb9798c79413a79c645b16340f0951e4ce711760
parent5cbab6303b4791a3e6713dfe2c5fda6a867f9adc (diff)
nvme-multipath: drop optimization for static ANA group IDs
Bit 6 in the ANACAP field is used to indicate that the ANA group ID doesn't change while the namespace is attached to the controller. There is an optimisation in the code to only allocate space for the ANA group header, as the namespace list won't change and hence would not need to be refreshed. However, this optimisation was never carried over to the actual workflow, which always assumes that the buffer is large enough to hold the ANA header _and_ the namespace list. So drop this optimisation and always allocate enough space. Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Hannes Reinecke <hare@suse.com> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@kernel.dk>
-rw-r--r--drivers/nvme/host/multipath.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index df4b3a6db51b..b9fff3b8ed1b 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -545,8 +545,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
545 timer_setup(&ctrl->anatt_timer, nvme_anatt_timeout, 0); 545 timer_setup(&ctrl->anatt_timer, nvme_anatt_timeout, 0);
546 ctrl->ana_log_size = sizeof(struct nvme_ana_rsp_hdr) + 546 ctrl->ana_log_size = sizeof(struct nvme_ana_rsp_hdr) +
547 ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc); 547 ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc);
548 if (!(ctrl->anacap & (1 << 6))) 548 ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32);
549 ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32);
550 549
551 if (ctrl->ana_log_size > ctrl->max_hw_sectors << SECTOR_SHIFT) { 550 if (ctrl->ana_log_size > ctrl->max_hw_sectors << SECTOR_SHIFT) {
552 dev_err(ctrl->device, 551 dev_err(ctrl->device,