]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/blob - releases/4.19.27/nvme-multipath-drop-optimization-for-static-ana-grou.patch
Linux 4.19.27
[thirdparty/kernel/stable-queue.git] / releases / 4.19.27 / nvme-multipath-drop-optimization-for-static-ana-grou.patch
1 From 2ab10acbfdaa0eea29b3d9cb87cbc963591dc51a Mon Sep 17 00:00:00 2001
2 From: Hannes Reinecke <hare@suse.de>
3 Date: Wed, 9 Jan 2019 09:45:15 +0100
4 Subject: nvme-multipath: drop optimization for static ANA group IDs
5
6 [ Upstream commit 78a61cd42a64f3587862b372a79e1d6aaf131fd7 ]
7
8 Bit 6 in the ANACAP field is used to indicate that the ANA group ID
9 doesn't change while the namespace is attached to the controller.
10 There is an optimisation in the code to only allocate space
11 for the ANA group header, as the namespace list won't change and
12 hence would not need to be refreshed.
13 However, this optimisation was never carried over to the actual
14 workflow, which always assumes that the buffer is large enough
15 to hold the ANA header _and_ the namespace list.
16 So drop this optimisation and always allocate enough space.
17
18 Reviewed-by: Christoph Hellwig <hch@lst.de>
19 Signed-off-by: Hannes Reinecke <hare@suse.com>
20 Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
21 Signed-off-by: Jens Axboe <axboe@kernel.dk>
22 Signed-off-by: Sasha Levin <sashal@kernel.org>
23 ---
24 drivers/nvme/host/multipath.c | 3 +--
25 1 file changed, 1 insertion(+), 2 deletions(-)
26
27 diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
28 index 815509dbed846..da8f5ad30c719 100644
29 --- a/drivers/nvme/host/multipath.c
30 +++ b/drivers/nvme/host/multipath.c
31 @@ -531,8 +531,7 @@ int nvme_mpath_init(struct nvme_ctrl *ctrl, struct nvme_id_ctrl *id)
32 timer_setup(&ctrl->anatt_timer, nvme_anatt_timeout, 0);
33 ctrl->ana_log_size = sizeof(struct nvme_ana_rsp_hdr) +
34 ctrl->nanagrpid * sizeof(struct nvme_ana_group_desc);
35 - if (!(ctrl->anacap & (1 << 6)))
36 - ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32);
37 + ctrl->ana_log_size += ctrl->max_namespaces * sizeof(__le32);
38
39 if (ctrl->ana_log_size > ctrl->max_hw_sectors << SECTOR_SHIFT) {
40 dev_err(ctrl->device,
41 --
42 2.19.1
43