linux-scsi.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: open-iscsi@googlegroups.com
Cc: James.Bottomley@HansenPartnership.com,
	linux-scsi@vger.kernel.org, mchan@broadcom.com
Subject: Re: [PATCH 2/2] bnx2i : Fix "cid #n not valid" issue
Date: Tue, 18 Aug 2009 12:48:06 -0500	[thread overview]
Message-ID: <4A8AE956.502@cs.wisc.edu> (raw)
In-Reply-To: <1248929411.26650.350.camel@anilgv-desktop>

On 07/29/2009 11:50 PM, Anil Veerabhadrappa wrote:
>
>      * when bnx2i_adapter_ready() fails, connection handle(cid) = 0 is
>        wrongly freed because 'cid' is not yet allocated for the endpoint
>      * Fix is to initialize bnx2i_ep->ep_iscsi_cid to '-1' in bnx2i_alloc_ep()
>        and not in bnx2i_ep_connect() to avoid releasing invalid 'cid'
>      * There is already a check in bnx2i_free_iscsi_cid() not to free
>        invalid iscsi connection handle (-1)
>
> Signed-off-by: Anil Veerabhadrappa<anilgv@broadcom.com>

This looks ok, but I think I got a review comment to change some of my 
code to use the definitions in kernel.h. So below you would want to use 
USHORT_MAX.

I am not sure if it will prevent the patch from getting merged or not 
since it will work either way.

Reviewed-by: Mike Christie <michaelc@cs.wisc.edu>



> ---
>   drivers/scsi/bnx2i/bnx2i_iscsi.c |    3 +--
>   1 files changed, 1 insertions(+), 2 deletions(-)
>
> diff --git a/drivers/scsi/bnx2i/bnx2i_iscsi.c b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> index 9535bb6..08d0bfc 100644
> --- a/drivers/scsi/bnx2i/bnx2i_iscsi.c
> +++ b/drivers/scsi/bnx2i/bnx2i_iscsi.c
> @@ -387,6 +387,7 @@ static struct iscsi_endpoint *bnx2i_alloc_ep(struct bnx2i_hba *hba)
>   	bnx2i_ep = ep->dd_data;
>   	INIT_LIST_HEAD(&bnx2i_ep->link);
>   	bnx2i_ep->state = EP_STATE_IDLE;
> +	bnx2i_ep->ep_iscsi_cid = (u16) -1;
>   	bnx2i_ep->hba = hba;
>   	bnx2i_ep->hba_age = hba->age;
>   	hba->ofld_conns_active++;
> @@ -1678,8 +1679,6 @@ static struct iscsi_endpoint *bnx2i_ep_connect(struct Scsi_Host *shost,
>   		goto net_if_down;
>   	}
>
> -	bnx2i_ep->state = EP_STATE_IDLE;
> -	bnx2i_ep->ep_iscsi_cid = (u16) -1;
>   	bnx2i_ep->num_active_cmds = 0;
>   	iscsi_cid = bnx2i_alloc_iscsi_cid(hba);
>   	if (iscsi_cid == -1) {


      reply	other threads:[~2009-08-18 17:48 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-07-30  4:50 [PATCH 2/2] bnx2i : Fix "cid #n not valid" issue Anil Veerabhadrappa
2009-08-18 17:48 ` Mike Christie [this message]

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=4A8AE956.502@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=James.Bottomley@HansenPartnership.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=mchan@broadcom.com \
    --cc=open-iscsi@googlegroups.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 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).