aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/block/nvme-core.c
diff options
context:
space:
mode:
authorKeith Busch <keith.busch@intel.com>2014-12-03 19:07:13 -0500
committerJens Axboe <axboe@fb.com>2014-12-03 21:10:45 -0500
commit9af8785a38d4528d6675247f873b0f1ae29f3be8 (patch)
tree65f7044e066a022c8d722e184ca1fcd2986b512f /drivers/block/nvme-core.c
parent709c8667ada1fa26ac941bb875892afc0046b3e2 (diff)
NVMe: Fix command setup on IO retry
On retry, the req->special is pointing to an already setup IOD, but we still need to setup the command context and callback, otherwise you'll see false twice completed errors and leak requests. Signed-off-by: Keith Busch <keith.busch@intel.com> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/block/nvme-core.c')
-rw-r--r--drivers/block/nvme-core.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/drivers/block/nvme-core.c b/drivers/block/nvme-core.c
index c7ea07ce9372..bcbdf832b1b0 100644
--- a/drivers/block/nvme-core.c
+++ b/drivers/block/nvme-core.c
@@ -640,8 +640,6 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
640 iod->private = req; 640 iod->private = req;
641 req->special = iod; 641 req->special = iod;
642 642
643 nvme_set_info(cmd, iod, req_completion);
644
645 if (req->cmd_flags & REQ_DISCARD) { 643 if (req->cmd_flags & REQ_DISCARD) {
646 void *range; 644 void *range;
647 /* 645 /*
@@ -677,6 +675,7 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
677 blk_mq_start_request(req); 675 blk_mq_start_request(req);
678 676
679 submit_iod: 677 submit_iod:
678 nvme_set_info(cmd, iod, req_completion);
680 spin_lock_irq(&nvmeq->q_lock); 679 spin_lock_irq(&nvmeq->q_lock);
681 if (req->cmd_flags & REQ_DISCARD) 680 if (req->cmd_flags & REQ_DISCARD)
682 nvme_submit_discard(nvmeq, ns, req, iod); 681 nvme_submit_discard(nvmeq, ns, req, iod);