Home Home > GIT Browse
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHannes Reinecke <hare@suse.de>2019-09-10 12:58:37 +0200
committerHannes Reinecke <hare@suse.de>2019-09-10 12:58:44 +0200
commitbe2a3215e1d7258b4dfd0fccdbe457e3afb861ce (patch)
tree3ba213bc61cb10a5702d18295b217b62bc149676
parentfb455e42ef412a0b53d02204beaa569513ed161e (diff)
nvme: cancel request synchronously (bsc#1145661).
-rw-r--r--patches.suse/nvme-cancel-request-synchronously.patch43
-rw-r--r--series.conf1
2 files changed, 44 insertions, 0 deletions
diff --git a/patches.suse/nvme-cancel-request-synchronously.patch b/patches.suse/nvme-cancel-request-synchronously.patch
new file mode 100644
index 0000000000..34441d5c65
--- /dev/null
+++ b/patches.suse/nvme-cancel-request-synchronously.patch
@@ -0,0 +1,43 @@
+From: Ming Lei <ming.lei@redhat.com>
+Date: Tue, 9 Apr 2019 06:31:22 +0800
+Subject: [PATCH] nvme: cancel request synchronously
+Git-commit: eb3afb75b57c28599af0dfa03a99579d410749e9
+Patch-Mainline: v5.1-rc5
+References: bsc#1145661
+
+nvme_cancel_request() is used in error handler, and it is always
+reliable to cancel request synchronously, and avoids possible race
+in which request may be completed after real hw queue is destroyed.
+
+One issue is reported by our customer on NVMe RDMA, in which freed ib
+queue pair may be used in nvme_rdma_complete_rq().
+
+Cc: Sagi Grimberg <sagi@grimberg.me>
+Cc: Bart Van Assche <bvanassche@acm.org>
+Cc: James Smart <james.smart@broadcom.com>
+Cc: linux-nvme@lists.infradead.org
+Reviewed-by: Keith Busch <keith.busch@intel.com>
+Reviewed-by: Christoph Hellwig <hch@lst.de>
+Signed-off-by: Ming Lei <ming.lei@redhat.com>
+Signed-off-by: Jens Axboe <axboe@kernel.dk>
+Acked-by: Hannes Reinecke <hare@suse.com>
+---
+ drivers/nvme/host/core.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
+index 470601980794..2c43e12b70af 100644
+--- a/drivers/nvme/host/core.c
++++ b/drivers/nvme/host/core.c
+@@ -288,7 +288,7 @@ bool nvme_cancel_request(struct request *req, void *data, bool reserved)
+ "Cancelling I/O %d", req->tag);
+
+ nvme_req(req)->status = NVME_SC_ABORT_REQ;
+- blk_mq_complete_request(req);
++ blk_mq_complete_request_sync(req);
+
+ }
+ EXPORT_SYMBOL_GPL(nvme_cancel_request);
+--
+2.16.4
+
diff --git a/series.conf b/series.conf
index f2fdef9054..46518c1c1a 100644
--- a/series.conf
+++ b/series.conf
@@ -22732,6 +22732,7 @@
patches.suse/platform-x86-pmc_atom-Drop-__initconst-on-dmi-table.patch
patches.suse/virtio-blk-limit-number-of-hw-queues-by-nr_cpu_ids.patch
patches.suse/blk-mq-introduce-blk_mq_complete_request_sync.patch
+ patches.suse/nvme-cancel-request-synchronously.patch
patches.suse/block-do-not-leak-memory-in-bio_copy_user_iov.patch
patches.suse/block-fix-the-return-errno-for-direct-IO.patch
patches.suse/mm-make-page-ref-count-overflow-check-tighter-and-more-explicit.patch