linux-nvme.lists.infradead.org archive mirror
 help / color / mirror / Atom feed
From: Chaitanya Kulkarni <Chaitanya.Kulkarni@wdc.com>
To: James Smart <jsmart2021@gmail.com>,
	"linux-nvme@lists.infradead.org" <linux-nvme@lists.infradead.org>
Subject: Re: [PATCH] nvme: add error message on mismatching controller ids
Date: Thu, 21 Nov 2019 20:16:46 +0000	[thread overview]
Message-ID: <BYAPR04MB5749300C95DFB14D882000DF864E0@BYAPR04MB5749.namprd04.prod.outlook.com> (raw)
In-Reply-To: 20191121175810.19501-1-jsmart2021@gmail.com

Looks good to me, just one nit with the commit message
and can be applied at the time of applying patch.

Reviewed-by: Chaitanya Kulkarni <chaitanya.kulkarni@wdc.com>

On 11/21/2019 09:58 AM, James Smart wrote:
> We've seen a few devices that return different controller
> id's to the Fabric Connect command vs the Identify(controller)
> command. It's currently hard to identify this failure by
> existing error messages. It comes across as a (re)connect
> attempt in the transport that fails with a -22 (-EINVAL)
> status. The issue is compounded by older kernels not having
> the controller id check or had the identify command overwrite
> the fabrics controller id value before it checked. Both resulted
> in cases where the devices appeared fine until more recent kernels.
>
> Clarify the reject by adding an error message on controller
> id mismatches.

When I applied this patch found that there is still some room
so we can get to the 72 columns (unless it is done with some purpose)
for the commit message, I've just adjusted the lines without changing 
any description :-

We've seen a few devices that return different controller id's to the
Fabric Connect command vs the Identify(controller) command. It's
currently hard to identify this failure by existing error messages.
It comes across as a (re)connect attempt in the transport that fails
with a -22 (-EINVAL) status. The issue is compounded by older kernels
not having the controller id check or had the identify command
overwrite the fabrics controller id value before it checked. Both
resulted in cases where the devices appeared fine until more recent
kernels.

Clarify the reject by adding an error message on controller id
mismatches.

>
> Signed-off-by: James Smart <jsmart2021@gmail.com>
> ---
>   drivers/nvme/host/core.c | 4 ++++
>   1 file changed, 4 insertions(+)
>
> diff --git a/drivers/nvme/host/core.c b/drivers/nvme/host/core.c
> index 9696404a6182..c272afb084d1 100644
> --- a/drivers/nvme/host/core.c
> +++ b/drivers/nvme/host/core.c
> @@ -2824,6 +2824,10 @@ int nvme_init_identify(struct nvme_ctrl *ctrl)
>   		 * admin connect
>   		 */
>   		if (ctrl->cntlid != le16_to_cpu(id->cntlid)) {
> +			dev_err(ctrl->device,
> +				"Mismatching cntlid: Connect %u vs Identify "
> +				"%u, rejecting\n",
> +				ctrl->cntlid, le16_to_cpu(id->cntlid));
>   			ret = -EINVAL;
>   			goto out_free;
>   		}
>


_______________________________________________
Linux-nvme mailing list
Linux-nvme@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/linux-nvme

  parent reply	other threads:[~2019-11-21 20:17 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-11-21 17:58 [PATCH] nvme: add error message on mismatching controller ids James Smart
2019-11-21 19:28 ` Ewan D. Milne
2019-11-21 20:16 ` Chaitanya Kulkarni [this message]
2019-11-22 14:40 ` Hannes Reinecke
2019-11-26 16:51 ` Christoph Hellwig
2019-11-26 17:39 ` Keith Busch

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=BYAPR04MB5749300C95DFB14D882000DF864E0@BYAPR04MB5749.namprd04.prod.outlook.com \
    --to=chaitanya.kulkarni@wdc.com \
    --cc=jsmart2021@gmail.com \
    --cc=linux-nvme@lists.infradead.org \
    /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;
as well as URLs for NNTP newsgroup(s).