Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 4bca70d0 authored by Christoph Hellwig's avatar Christoph Hellwig Committed by Jens Axboe
Browse files

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: default avatarChristoph Hellwig <hch@lst.de>
Signed-off-by: default avatarSagi Grimberg <sagi@grimberg.me>
Signed-off-by: default avatarJens Axboe <axboe@fb.com>
parent f2cd54d3
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -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 = {