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
commit015acd548b9a5e320babbe797db2af46b4abda38 (patch)
treeeee9f4ef189147ca43f801900773d8c8958c2879
parent70873787710ce23cdbd079ffae775ae6060841ee (diff)
parent1d6ec2f3466ecad54a3adb754d1810923e15f165 (diff)
Merge branch 'users/hare/SLE15/for-next' into SLE15
Pull nvme fixes from Hannes Reinecke
-rw-r--r--patches.fixes/nvme-multipath-fix-ana-log-nsid-lookup-when-nsid-is-.patch76
-rw-r--r--patches.suse/nvme-Return-BLK_STS_TARGET-if-the-DNR-bit-is-set.patch36
-rw-r--r--series.conf2
3 files changed, 114 insertions, 0 deletions
diff --git a/patches.fixes/nvme-multipath-fix-ana-log-nsid-lookup-when-nsid-is-.patch b/patches.fixes/nvme-multipath-fix-ana-log-nsid-lookup-when-nsid-is-.patch
new file mode 100644
index 0000000000..809c595174
--- /dev/null
+++ b/patches.fixes/nvme-multipath-fix-ana-log-nsid-lookup-when-nsid-is-.patch
@@ -0,0 +1,76 @@
+From: Anton Eidelman <anton@lightbitslabs.com>
+Date: Tue, 20 Aug 2019 16:00:27 -0700
+Subject: [PATCH] nvme-multipath: fix ana log nsid lookup when nsid is not found
+Patch-Mainline: submitted linux-nvme 2019/08/21
+References: bsc#1141554
+
+ANA log parsing invokes nvme_update_ana_state() per ANA group desc.
+This updates the state of namespaces with nsids in desc->nsids[].
+
+Both ctrl->namespaces list and desc->nsids[] array are sorted by nsid.
+Hence nvme_update_ana_state() performs a single walk over ctrl->namespaces:
+- if current namespace matches the current desc->nsids[n],
+ this namespace is updated, and n is incremented.
+- the process stops when it encounters the end of either
+ ctrl->namespaces end or desc->nsids[]
+
+In case desc->nsids[n] does not match any of ctrl->namespaces,
+the remaining nsids following desc->nsids[n] will not be updated.
+Such situation was considered abnormal and generated WARN_ON_ONCE.
+
+However ANA log MAY contain nsids not (yet) found in ctrl->namespaces.
+For example, lets consider the following scenario:
+- nvme0 exposes namespaces with nsids = [2, 3] to the host
+- a new namespace nsid = 1 is added dynamically
+- also, a ANA topology change is triggered
+- NS_CHANGED aen is generated and triggers scan_work
+- before scan_work discovers nsid=1 and creates a namespace, a NOTICE_ANA
+ aen was issues and ana_work receives ANA log with nsids=[1, 2, 3]
+
+Result: ana_work fails to update ANA state on existing namespaces [2, 3]
+
+Solution:
+Change the way nvme_update_ana_state() namespace list walk
+checks the current namespace against desc->nsids[n] as follows:
+a) ns->head->ns_id < desc->nsids[n]: keep walking ctrl->namespaces.
+b) ns->head->ns_id == desc->nsids[n]: match, update the namespace
+c) ns->head->ns_id >= desc->nsids[n]: skip to desc->nsids[n+1]
+
+This enables correct operation in the scenario described above.
+This also allows ANA log to contain nsids currently invisible
+to the host, i.e. inactive nsids.
+
+Signed-off-by: Anton Eidelman <anton@lightbitslabs.com>
+Signed-off-by: Sagi Grimberg <sagi@grimberg.me>
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/nvme/host/multipath.c | 8 +++++---
+ 1 file 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;
+ }
+
+--
+2.16.4
+
diff --git a/patches.suse/nvme-Return-BLK_STS_TARGET-if-the-DNR-bit-is-set.patch b/patches.suse/nvme-Return-BLK_STS_TARGET-if-the-DNR-bit-is-set.patch
new file mode 100644
index 0000000000..723d7ced63
--- /dev/null
+++ b/patches.suse/nvme-Return-BLK_STS_TARGET-if-the-DNR-bit-is-set.patch
@@ -0,0 +1,36 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Tue, 6 Aug 2019 12:47:17 +0200
+Subject: [PATCH] nvme: Return BLK_STS_TARGET if the DNR bit is set
+References: bsc#1142076
+Patch-Mainline: never, solved differently upstream
+
+If the DNR bit is set we should not retry the command, even if
+the standard status evaluation indicates so.
+
+
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/nvme/host/core.c | 7 +++++++
+ 1 file changed, 7 insertions(+)
+
+diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
+index 6afc37292f28..6faa3a99253a 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);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 7cd7f5342a..28bf1049c9 100644
--- a/series.conf
+++ b/series.conf
@@ -23444,6 +23444,8 @@
patches.suse/nvme-Do-not-remove-namespaces-during-reset.patch
patches.suse/nvme-flush-scan_work-when-resetting-controller.patch
patches.suse/nvme-skip-nvme_update_disk_info-if-the-controller-is.patch
+ patches.suse/nvme-Return-BLK_STS_TARGET-if-the-DNR-bit-is-set.patch
+ patches.fixes/nvme-multipath-fix-ana-log-nsid-lookup-when-nsid-is-.patch
patches.kabi/kabi-drop-LINUX_MIB_TCPWQUEUETOOBIG-snmp-counter.patch
patches.kabi/kabi-move-sysctl_tcp_min_snd_mss-to-preserve-struct-.patch
patches.suse/block-Fix-a-NULL-pointer-dereference-in-generic_make.patch