From 9af8785a38d4528d6675247f873b0f1ae29f3be8 Mon Sep 17 00:00:00 2001 From: Keith Busch Date: Wed, 3 Dec 2014 17:07:13 -0700 Subject: 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 Signed-off-by: Jens Axboe --- drivers/block/nvme-core.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) (limited to 'drivers/block') 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, iod->private = req; req->special = iod; - nvme_set_info(cmd, iod, req_completion); - if (req->cmd_flags & REQ_DISCARD) { void *range; /* @@ -677,6 +675,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); -- cgit v1.2.3