All of lore.kernel.org
 help / color / mirror / Atom feed
From: aeasi@marvell.com (Arun Easi)
Subject: [PATCH 3/3] nvme-fc: fail reconnect if state change fails
Date: Fri, 17 May 2019 17:18:11 -0700	[thread overview]
Message-ID: <alpine.LRH.2.21.9999.1905171715520.19585@mvluser05.qlc.com> (raw)
In-Reply-To: <20190516083740.95894-4-hare@suse.de>

On Thu, 16 May 2019, 1:37am, Hannes Reinecke wrote:

> If the final state change to LIVE in nvme_fc_create_association()
> fails the controller is not operational as no I/O is possible.
> So we should be returning an error here to reschedule reconnect.
> 
> Signed-off-by: Hannes Reinecke <hare at suse.com>
> ---
>  drivers/nvme/host/fc.c | 14 ++++++++++----
>  1 file changed, 10 insertions(+), 4 deletions(-)
> 
> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> index e5c81ba2b7a1..9f9300cbdb62 100644
> --- a/drivers/nvme/host/fc.c
> +++ b/drivers/nvme/host/fc.c
> @@ -2620,7 +2620,6 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
>  {
>  	struct nvmf_ctrl_options *opts = ctrl->ctrl.opts;
>  	int ret;
> -	bool changed;
>  
>  	++ctrl->ctrl.nr_reconnects;
>  
> @@ -2725,12 +2724,19 @@ nvme_fc_create_association(struct nvme_fc_ctrl *ctrl)
>  			goto out_term_aen_ops;
>  	}
>  
> -	changed = nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE);
> +	if (nvme_change_ctrl_state(&ctrl->ctrl, NVME_CTRL_LIVE)) {

Should not this be !nvme_change_ctrl_state()?

Regards,
-Arun
> +		if (ctrl->ctrl.state != NVME_CTRL_DELETING) {
> +			dev_err(ctrl->ctrl.device,
> +				"NVME-FC{%d}: error_recovery: Couldn't change "
> +				"state from %s to LIVE\n", ctrl->cnum,
> +				nvme_ctrl_state_name(&ctrl->ctrl));
> +			return -EAGAIN;
> +		}
> +	}
>  
>  	ctrl->ctrl.nr_reconnects = 0;
>  
> -	if (changed)
> -		nvme_start_ctrl(&ctrl->ctrl);
> +	nvme_start_ctrl(&ctrl->ctrl);
>  
>  	return 0;	/* Success */
>  
> 

  parent reply	other threads:[~2019-05-18  0:18 UTC|newest]

Thread overview: 14+ 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 ` [PATCH 2/3] nvme-fc: track state change failures during reconnect Hannes Reinecke
2019-05-16 16:24   ` 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 [this message]
2019-05-18  0:21     ` Arun Easi
2019-05-17  6:42 [PATCHv2 0/3] nvme-fc: track state change failures Hannes Reinecke
2019-05-17  6:42 ` [PATCH 3/3] nvme-fc: fail reconnect if state change fails Hannes Reinecke
2019-05-17 16:10   ` James Smart
2019-05-17 18:34     ` Hannes Reinecke
2019-05-17 18:52       ` James Smart

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=alpine.LRH.2.21.9999.1905171715520.19585@mvluser05.qlc.com \
    --to=aeasi@marvell.com \
    /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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.