Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: hare@suse.de (Hannes Reinecke)
Subject: [PATCH 2/3] nvme-fc: track state change failures during reconnect
Date: Thu, 16 May 2019 10:37:39 +0200	[thread overview]
Message-ID: <20190516083740.95894-3-hare@suse.de> (raw)
In-Reply-To: <20190516083740.95894-1-hare@suse.de>

The nvme-fc driver has several situation under which an expected
state transition fails, but doesn't print out any messages if
this happens.
The patch adds logging for these situations.

Signed-off-by: Hannes Reinecke <hare at suse.com>
---
 drivers/nvme/host/fc.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
index 0c9e036afd09..e5c81ba2b7a1 100644
--- a/drivers/nvme/host/fc.c
+++ b/drivers/nvme/host/fc.c
@@ -2867,8 +2867,12 @@ nvme_fc_reconnect_or_delete(struct nvme_fc_ctrl *ctrl, int status)
 	unsigned long recon_delay = ctrl->ctrl.opts->reconnect_delay * HZ;
 	bool recon = true;
 
-	if (ctrl->ctrl.state != NVME_CTRL_CONNECTING)
+	if (ctrl->ctrl.state != NVME_CTRL_CONNECTING) {
+		dev_info(ctrl->ctrl.device,
+			 "NVME-FC{%d}: couldn't reconnect in state %s\n",
+			 ctrl->cnum, nvme_ctrl_state_name(&ctrl->ctrl));
 		return;
+	}
 
 	if (portptr->port_state == FC_OBJSTATE_ONLINE)
 		dev_info(ctrl->ctrl.device,
@@ -2914,7 +2918,8 @@ __nvme_fc_terminate_io(struct nvme_fc_ctrl *ctrl)
 	    !nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_CONNECTING))
 		dev_err(ctrl->ctrl.device,
 			"NVME-FC{%d}: error_recovery: Couldn't change state "
-			"to CONNECTING\n", ctrl->cnum);
+			"from %s to CONNECTING\n", ctrl->cnum,
+			nvme_ctrl_state_name(&ctrl->ctrl));
 }
 
 static void
-- 
2.16.4

  parent reply	other threads:[~2019-05-16  8:37 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-05-16  8:37 [PATCH 0/3] nvme-fc: track state change failures Hannes Reinecke
2019-05-16  8:37 ` [PATCH 1/3] nvme: separate out nvme_ctrl_state_name() Hannes Reinecke
2019-05-16 13:55   ` Minwoo Im
2019-05-16 16:24   ` James Smart
2019-05-16  8:37 ` Hannes Reinecke [this message]
2019-05-16 16:24   ` [PATCH 2/3] nvme-fc: track state change failures during reconnect James Smart
2019-05-16  8:37 ` [PATCH 3/3] nvme-fc: fail reconnect if state change fails Hannes Reinecke
2019-05-16 16:25   ` James Smart
2019-05-18  0:18   ` Arun Easi
2019-05-18  0:21     ` Arun Easi
  -- strict thread matches above, loose matches on Subject: below --
2019-05-17  6:42 [PATCHv2 0/3] nvme-fc: track state change failures Hannes Reinecke
2019-05-17  6:42 ` [PATCH 2/3] nvme-fc: track state change failures during reconnect Hannes Reinecke

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20190516083740.95894-3-hare@suse.de \
    --to=hare@suse.de \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox