Linux-NVME Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Himanshu Madhani <himanshu.madhani@oracle.com>
To: James Smart <james.smart@broadcom.com>
Cc: linux-nvme@lists.infradead.org
Subject: Re: [PATCH] nvme-fc: fail new connections to a deleted host or remote port
Date: Fri, 18 Sep 2020 11:38:27 -0500	[thread overview]
Message-ID: <8C47B7DD-E299-4E01-AFB6-40FD5A232F60@oracle.com> (raw)
In-Reply-To: <20200917203322.57405-1-james.smart@broadcom.com>



> On Sep 17, 2020, at 3:33 PM, James Smart <james.smart@broadcom.com> wrote:
> 
> The lldd may have made calls to delete a remote port or local port and
> the delete is in progress when the cli then attempts to create a new
> controller. Currently, this proceeds without error although it can't be
> very successful.
> 
> Fix this by validating that both the host port and remote port are
> present when a new controller is to be created.
> 
> Signed-off-by: James Smart <james.smart@broadcom.com>
> ---
> drivers/nvme/host/fc.c | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/nvme/host/fc.c b/drivers/nvme/host/fc.c
> index bc4e1af587cc..3f9eb37fe779 100644
> --- a/drivers/nvme/host/fc.c
> +++ b/drivers/nvme/host/fc.c
> @@ -3671,12 +3671,14 @@ nvme_fc_create_ctrl(struct device *dev, struct nvmf_ctrl_options *opts)
> 	spin_lock_irqsave(&nvme_fc_lock, flags);
> 	list_for_each_entry(lport, &nvme_fc_lport_list, port_list) {
> 		if (lport->localport.node_name != laddr.nn ||
> -		    lport->localport.port_name != laddr.pn)
> +		    lport->localport.port_name != laddr.pn ||
> +		    lport->localport.port_state != FC_OBJSTATE_ONLINE)
> 			continue;
> 
> 		list_for_each_entry(rport, &lport->endp_list, endp_list) {
> 			if (rport->remoteport.node_name != raddr.nn ||
> -			    rport->remoteport.port_name != raddr.pn)
> +			    rport->remoteport.port_name != raddr.pn ||
> +			    rport->remoteport.port_state != FC_OBJSTATE_ONLINE)
> 				continue;
> 
> 			/* if fail to get reference fall through. Will error */
> -- 
> 2.26.2
> 
> _______________________________________________
> Linux-nvme mailing list
> Linux-nvme@lists.infradead.org
> http://lists.infradead.org/mailman/listinfo/linux-nvme

Looks good.

Reviewed-by: Himanshu Madhani <himanshu.madhani@oracle.com>

--
Himanshu Madhani	 Oracle Linux Engineering


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

  reply	other threads:[~2020-09-18 16:38 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-09-17 20:33 [PATCH] nvme-fc: fail new connections to a deleted host or remote port James Smart
2020-09-18 16:38 ` Himanshu Madhani [this message]
2020-09-21 14:45 ` Christoph Hellwig

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=8C47B7DD-E299-4E01-AFB6-40FD5A232F60@oracle.com \
    --to=himanshu.madhani@oracle.com \
    --cc=james.smart@broadcom.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