Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-08-21 15:44:07 +0200
committerHannes Reinecke <hare@suse.de>2019-08-21 15:44:07 +0200
commit59bbc3dee1394ebe6308036f1e64ef469e00b81d (patch)
tree057880a2fddf6d678aeb1f9ae45edf14714ddba3
parent52a6c2f892d0b0635aff75c36876a7a6c76f313d (diff)
nvme-multipath: fix ana log nsid lookup when nsid is not found
(bsc#1141554). suse-commit: 1d6ec2f3466ecad54a3adb754d1810923e15f165
-rw-r--r--drivers/nvme/host/multipath.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
index 961d2a00a216..70ae22569947 100644
--- a/drivers/nvme/host/multipath.c
+++ b/drivers/nvme/host/multipath.c
@@ -449,14 +449,16 @@ static int nvme_update_ana_state(struct nvme_ctrl *ctrl,
mutex_lock(&ctrl->namespaces_mutex);
list_for_each_entry(ns, &ctrl->namespaces, list) {
- if (ns->head->ns_id != le32_to_cpu(desc->nsids[n]))
+ unsigned nsid = le32_to_cpu(desc->nsids[n]);
+
+ if (ns->head->ns_id < nsid)
continue;
- nvme_update_ns_ana_state(desc, ns);
+ if (ns->head->ns_id == nsid)
+ nvme_update_ns_ana_state(desc, ns);
if (++n == nr_nsids)
break;
}
mutex_unlock(&ctrl->namespaces_mutex);
- WARN_ON_ONCE(n < nr_nsids);
return 0;
}