Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-05-02 11:34:00 +0200
committerHannes Reinecke <hare@suse.de>2019-05-02 11:34:00 +0200
commitd40d16099d9ba0757843f07a91af24797ba85cce (patch)
tree9bbe7c39cec85cef21f5945b370e4d2a90b06bd7
parenta7486ede2f33f14359392782ec0e414ef350b200 (diff)
nvme-multipath: split bios with the ns_head bio_set before
submitting (bsc#1103259, bsc#1131673).
-rw-r--r--patches.fixes/nvme-multipath-split-bios-with-the-ns_head-bio_set-b.patch45
-rw-r--r--series.conf3
2 files changed, 48 insertions, 0 deletions
diff --git a/patches.fixes/nvme-multipath-split-bios-with-the-ns_head-bio_set-b.patch b/patches.fixes/nvme-multipath-split-bios-with-the-ns_head-bio_set-b.patch
new file mode 100644
index 0000000000..67fa11cf5e
--- /dev/null
+++ b/patches.fixes/nvme-multipath-split-bios-with-the-ns_head-bio_set-b.patch
@@ -0,0 +1,45 @@
+From: Hannes Reinecke <hare@suse.de>
+Date: Tue, 30 Apr 2019 18:57:09 +0200
+Subject: [PATCH] nvme-multipath: split bios with the ns_head bio_set before
+ submitting
+Git-commit: 525aa5a705d86e193726ee465d1a975265fabf19
+Git-repo: git://git.infradead.org/nvme.git
+Patch-Mainline: queued in subsystem maintainer tree
+References: bsc#1103259, bsc#1131673
+
+If the bio is moved to a different queue via blk_steal_bios() and
+the original queue is destroyed in nvme_remove_ns() we'll be ending
+with a crash in bio_endio() as the mempool for the split bio bvecs
+had already been destroyed.
+So split the bio using the original queue (which will remain during the
+lifetime of the bio) before sending it down to the underlying device.
+
+Signed-off-by: Hannes Reinecke <hare@suse.com>
+Reviewed-by: Ming Lei <ming.lei@redhat.com>
+Signed-off-by: Christoph Hellwig <hch@lst.de>
+---
+ drivers/nvme/host/multipath.c | 8 ++++++++
+ 1 file changed, 8 insertions(+)
+
+diff --git a/drivers/nvme/host/multipath.c b/drivers/nvme/host/multipath.c
+index f0716f6ce41f..e6ddc83223df 100644
+--- a/drivers/nvme/host/multipath.c
++++ b/drivers/nvme/host/multipath.c
+@@ -232,6 +232,14 @@ static blk_qc_t nvme_ns_head_make_request(struct request_queue *q,
+ blk_qc_t ret = BLK_QC_T_NONE;
+ int srcu_idx;
+
++ /*
++ * The namespace might be going away and the bio might
++ * be moved to a different queue via blk_steal_bios(),
++ * so we need to use the bio_split pool from the original
++ * queue to allocate the bvecs from.
++ */
++ blk_queue_split(q, &bio);
++
+ srcu_idx = srcu_read_lock(&head->srcu);
+ ns = nvme_find_path(head);
+ if (likely(ns)) {
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index 946853ea46..f05f8bac33 100644
--- a/series.conf
+++ b/series.conf
@@ -21560,6 +21560,9 @@
# git://git.kernel.dk/linux-block.git for-next
patches.fixes/md-batch-flush-requests.patch
+ # git://git.infradead.org/nvme.git nvme-5.2
+ patches.fixes/nvme-multipath-split-bios-with-the-ns_head-bio_set-b.patch
+
# out-of-tree patches
patches.arch/powerpc-pseries-Track-LMB-nid-instead-of-using-devic.patch
patches.arch/powerpc-tm-Avoid-machine-crash-on-rt_sigreturn.patch