diff options
author | James Smart <jsmart2021@gmail.com> | 2017-05-15 20:10:22 -0400 |
---|---|---|
committer | Christoph Hellwig <hch@lst.de> | 2017-05-22 14:55:29 -0400 |
commit | 2cb657bc0242dfdca20869685bf179774ef1a6fb (patch) | |
tree | 3ea1fd2d90506cfe922ea123668d5c56a182a74d | |
parent | e392e1f1f408fe8baf1046c970d05cbf1f0ec945 (diff) |
nvme_fc: remove extra controller reference taken on reconnect
fix extra controller reference taken on reconnect by moving
reference to initial controller create
Signed-off-by: James Smart <james.smart@broadcom.com>
Reviewed-by: Hannes Reinecke <hare@suse.com>
Reviewed-by: Johannes Thumshirn <jthumshirn@suse.de>
Signed-off-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | drivers/nvme/host/fc.c | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c index 775869c69df6..14a009e43aa5 100644 --- a/drivers/nvme/host/fc.c +++ b/drivers/nvme/host/fc.c | |||
@@ -2395,8 +2395,6 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl) | |||
2395 | 2395 | ||
2396 | ctrl->ctrl.opts->nr_reconnects = 0; | 2396 | ctrl->ctrl.opts->nr_reconnects = 0; |
2397 | 2397 | ||
2398 | kref_get(&ctrl->ctrl.kref); | ||
2399 | |||
2400 | if (ctrl->queue_count > 1) { | 2398 | if (ctrl->queue_count > 1) { |
2401 | nvme_start_queues(&ctrl->ctrl); | 2399 | nvme_start_queues(&ctrl->ctrl); |
2402 | nvme_queue_scan(&ctrl->ctrl); | 2400 | nvme_queue_scan(&ctrl->ctrl); |
@@ -2793,7 +2791,6 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, | |||
2793 | ctrl->ctrl.opts = NULL; | 2791 | ctrl->ctrl.opts = NULL; |
2794 | /* initiate nvme ctrl ref counting teardown */ | 2792 | /* initiate nvme ctrl ref counting teardown */ |
2795 | nvme_uninit_ctrl(&ctrl->ctrl); | 2793 | nvme_uninit_ctrl(&ctrl->ctrl); |
2796 | nvme_put_ctrl(&ctrl->ctrl); | ||
2797 | 2794 | ||
2798 | /* as we're past the point where we transition to the ref | 2795 | /* as we're past the point where we transition to the ref |
2799 | * counting teardown path, if we return a bad pointer here, | 2796 | * counting teardown path, if we return a bad pointer here, |
@@ -2809,6 +2806,8 @@ nvme_fc_init_ctrl(struct device *dev, struct nvmf_ctrl_options *opts, | |||
2809 | return ERR_PTR(ret); | 2806 | return ERR_PTR(ret); |
2810 | } | 2807 | } |
2811 | 2808 | ||
2809 | kref_get(&ctrl->ctrl.kref); | ||
2810 | |||
2812 | dev_info(ctrl->ctrl.device, | 2811 | dev_info(ctrl->ctrl.device, |
2813 | "NVME-FC{%d}: new ctrl: NQN \"%s\"\n", | 2812 | "NVME-FC{%d}: new ctrl: NQN \"%s\"\n", |
2814 | ctrl->cnum, ctrl->ctrl.opts->subsysnqn); | 2813 | ctrl->cnum, ctrl->ctrl.opts->subsysnqn); |