Home Home > GIT Browse > SLE12-SP5-AZURE
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorTakashi Iwai <tiwai@suse.de>2019-08-21 18:55:45 +0200
committerTakashi Iwai <tiwai@suse.de>2019-08-21 18:55:45 +0200
commitcd060c94c789119a8e71e1c2048cab65967cdf27 (patch)
treeff81fe299d27f9e1fbaee22d0b64312c38a6fd53
parent7d0357011caea1e33b28abc87dfe6144314871f1 (diff)
parent59bbc3dee1394ebe6308036f1e64ef469e00b81d (diff)
Merge branch 'users/hare/SLE15/for-next' into SLE15
Pull nvme fixes from Hannes Reinecke suse-commit: 015acd548b9a5e320babbe797db2af46b4abda38
-rw-r--r--drivers/nvme/host/core.c7
-rw-r--r--drivers/nvme/host/multipath.c8
2 files changed, 12 insertions, 3 deletions
diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
index 673b060a056c..8a8d4a966e7e 100644
--- a/drivers/nvme/host/core.c
+++ b/drivers/nvme/host/core.c
@@ -265,6 +265,13 @@ void nvme_complete_rq(struct request *req)
return;
}
}
+ /*
+ * Any pathing error might be retried, but the DNR bit takes
+ * precedence. So return BLK_STS_TARGET if the DNR bit is set
+ * to avoid retrying.
+ */
+ if (blk_path_error(status) && nvme_req(req)->status & NVME_SC_DNR)
+ status = BLK_STS_TARGET;
blk_mq_end_request(req, status);
}
EXPORT_SYMBOL_GPL(nvme_complete_rq);
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;
}