Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-05-03 13:08:29 +0200
committerHannes Reinecke <hare@suse.de>2019-05-03 13:08:29 +0200
commite2a50948b882d11691c918dfc102575df01b3f4b (patch)
tree59567fd421318d428ae61cb9c251c2e7468caa1b
parent0222aa2c4b0d5bcd8416a0797d56917372111920 (diff)
nvme-multipath: avoid crash on invalid subsystem cntlid
enumeration (bsc#1129273).
-rw-r--r--patches.fixes/nvme-multipath-avoid-crash-on-invalid-subsystem-cntl.patch33
-rw-r--r--series.conf1
2 files changed, 34 insertions, 0 deletions
diff --git a/patches.fixes/nvme-multipath-avoid-crash-on-invalid-subsystem-cntl.patch b/patches.fixes/nvme-multipath-avoid-crash-on-invalid-subsystem-cntl.patch
new file mode 100644
index 0000000000..9fe8cb20d6
--- /dev/null
+++ b/patches.fixes/nvme-multipath-avoid-crash-on-invalid-subsystem-cntl.patch
@@ -0,0 +1,33 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Fri, 29 Mar 2019 10:57:54 +0100
+Subject: [PATCH] nvme-multipath: avoid crash on invalid subsystem cntlid
+ enumeration
+Patch-Mainline: submitted linux-nvme 2019/04/04
+References: bsc#1129273
+
+A process holding an open reference to a removed disk prevents it
+from completing deletion, so its name continues to exist. A subsequent
+gendisk creation may have the same cntlid which risks collision when
+using that for the name. Use the unique ctrl->instance instead.
+
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/nvme/host/multipath.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
+index f0716f6ce41f..2551264ef2b5 100644
+--- a/drivers/nvme/host/multipath.c
++++ b/drivers/nvme/host/multipath.c
+@@ -31,7 +31,7 @@ void nvme_set_disk_name(char *disk_name, struct nvme_ns *ns,
+ sprintf(disk_name, "nvme%dn%d", ctrl->instance, ns->head->instance);
+ } else if (ns->head->disk) {
+ sprintf(disk_name, "nvme%dc%dn%d", ctrl->subsys->instance,
+- ctrl->cntlid, ns->head->instance);
++ ctrl->instance, ns->head->instance);
+ *flags = GENHD_FL_HIDDEN;
+ } else {
+ sprintf(disk_name, "nvme%dn%d", ctrl->subsys->instance,
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 4a1d1a9ee4..1f2def58dd 100644
--- a/series.conf
+++ b/series.conf
@@ -21590,6 +21590,7 @@
patches.fixes/ch-add-missing-mutex_lock-mutex_unlock-in-ch_release.patch
patches.fixes/ch-fixup-refcounting-imbalance-for-SCSI-devices.patch
patches.suse/scsi-libsas-allocate-sense-buffer-for-bsg-queue.patch
+ patches.fixes/nvme-multipath-avoid-crash-on-invalid-subsystem-cntl.patch
########################################################
# end of sorted patches