[PATCH] nvme_fc: remove extra controller reference taken on reconnect

Subsystems: nvm express driver, nvm express fc transport drivers, the rest

STALE3440d

2 messages, 2 authors, 2017-05-10 · open the first message on its own page

[PATCH] nvme_fc: remove extra controller reference taken on reconnect

From: jsmart2021@gmail.com <hidden>
Date: 2017-05-04 18:06:54

From: James Smart <redacted>

remove extra controller reference taken on reconnect

Signed-off-by: James Smart <james.smart at broadcom.com>
---
 drivers/nvme/host/fc.c | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)
diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 622cac5f5db5..9993ff8d5656 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2395,13 +2395,14 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
 			goto out_term_aen_ops;
 	}
 
+	if (ctrl->ctrl.state == NVME_CTRL_NEW)
+		kref_get(&ctrl->ctrl.kref);
+
 	changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
 	WARN_ON_ONCE(!changed);
 
 	ctrl->ctrl.opts->nr_reconnects = 0;
 
-	kref_get(&ctrl->ctrl.kref);
-
 	if (ctrl->queue_count > 1) {
 		nvme_start_queues(&ctrl->ctrl);
 		nvme_queue_scan(&ctrl->ctrl);
-- 
2.11.0

[PATCH] nvme_fc: remove extra controller reference taken on reconnect

From: hch@infradead.org (Christoph Hellwig)
Date: 2017-05-10 17:05:58

On Thu, May 04, 2017@11:06:54AM -0700, jsmart2021@gmail.com wrote:
From: James Smart <jsmart2021 at gmail.com>

remove extra controller reference taken on reconnect
I think proper fix would be to move the kref_get into nvme_fc_init_ctrl
just after the call to nvme_fc_create_association.
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help