summaryrefslogtreecommitdiffstats
path: root/drivers/nvme
diff options
context:
space:
mode:
authorChristoph Hellwig <hch@lst.de>2017-03-30 13:41:31 +0200
committerJens Axboe <axboe@fb.com>2017-04-04 09:48:23 -0600
commit4bca70d0673927a8bef4b1de5fd8ddc735698a6b (patch)
treeb50ce0d3468e45cd9d1e989eee55f0982bf1e9f0 /drivers/nvme
parentf2cd54d3eba3a2048edcb91f145336180c55aee5 (diff)
downloadlinux-0-day-4bca70d0673927a8bef4b1de5fd8ddc735698a6b.tar.gz
linux-0-day-4bca70d0673927a8bef4b1de5fd8ddc735698a6b.tar.xz
nvme-fc: drop ctrl for all command completions
A requeue means we go through nvme_fc_start_fcp_op again and get another controller reference. To make sure the refcount doesn't leak we also need to drop it for every completion that came from the LLDD. Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Sagi Grimberg <sagi@grimberg.me> Signed-off-by: Jens Axboe <axboe@fb.com>
Diffstat (limited to 'drivers/nvme')
-rw-r--r--drivers/nvme/host/fc.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index bae10a95b1255..c7e6da2a61087 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -1937,7 +1937,7 @@ nvme_fc_complete_rq(struct request *rq)
if (nvme_req_needs_retry(rq, rq->errors)) {
rq->retries++;
nvme_requeue_req(rq);
- return;
+ goto put_ctrl;
}
if (blk_rq_is_passthrough(rq))
@@ -1946,9 +1946,10 @@ nvme_fc_complete_rq(struct request *rq)
error = nvme_error_status(rq->errors);
}
+ blk_mq_end_request(rq, error);
+put_ctrl:
nvme_fc_ctrl_put(ctrl);
- blk_mq_end_request(rq, error);
}
static const struct blk_mq_ops nvme_fc_mq_ops = {