Skip to contentSkip to conversation

NVMe: Fix command setup on IO retry

PATCH New Keith Busch 2 participants 2 messages Dec 4, 2014

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 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 at intel.com>
---
 drivers/block/nvme-core.c |    3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)
drivers/block/nvme-core.c +1 -2
index 0da7756..23dd4fd 100644
@@ -641,8 +641,6 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
 	iod->private = req;
 	req->special = iod;
 
-	nvme_set_info(cmd, iod, req_completion);
-
 	if (req->cmd_flags & REQ_DISCARD) {
 		void *range;
 		/*
@@ -678,6 +676,7 @@ static int nvme_queue_rq(struct blk_mq_hw_ctx *hctx,
 	blk_mq_start_request(req);
 
  submit_iod:
+	nvme_set_info(cmd, iod, req_completion);
 	spin_lock_irq(&nvmeq->q_lock);
 	if (req->cmd_flags & REQ_DISCARD)
 		nvme_submit_discard(nvmeq, ns, req, iod);
Signature · 1 line
1.7.10.4
#1 lore raw

PATCH 1/1 NVMe: Fix command setup on IO retry

Quoted 3 lines · Keith Busch

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.

Good catch!

I'll queue this up for 3.19.

Signature · 1 line
Jens Axboe