All of lore.kernel.org
 help / color / mirror / Atom feed
From: Mike Christie <michaelc@cs.wisc.edu>
To: Jay Kallickal <jayamohank@gmail.com>
Cc: jbottomley@parallels.com, linux-scsi@vger.kernel.org,
	Jayamohan Kallickal <jayamohan.kallickal@emulex.com>,
	Minh Tran <minhduc.tran@emulex.com>,
	John Soni Jose <sony.john-n@emulex.com>
Subject: Re: [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed
Date: Wed, 07 May 2014 17:18:38 -0500	[thread overview]
Message-ID: <536AB13E.6080906@cs.wisc.edu> (raw)
In-Reply-To: <1399340492-2136-7-git-send-email-jkallickal@emulex.com>

On 05/05/2014 08:41 PM, Jay Kallickal wrote:
> From: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> 
>  During heavy IO in multipath environment with many active sessions
>  and port-bouncing happening, there is a race condition because of
>  which beiscsi_prcess_cqe() gets called for a connection whose
>  endpoint is freed.
> 
>  Checking endpoint reference for a connection before processing in
>  beiscsi_process_cq().
> 
> Signed-off-by: Minh Tran <minhduc.tran@emulex.com>
> Signed-off-by: John Soni Jose <sony.john-n@emulex.com>
> Signed-off-by: Jayamohan Kallickal <jayamohan.kallickal@emulex.com>
> ---
>  drivers/scsi/be2iscsi/be_main.c | 11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> diff --git a/drivers/scsi/be2iscsi/be_main.c b/drivers/scsi/be2iscsi/be_main.c
> index dccda6c..5a7022f 100644
> --- a/drivers/scsi/be2iscsi/be_main.c
> +++ b/drivers/scsi/be2iscsi/be_main.c
> @@ -2110,6 +2110,16 @@ static unsigned int beiscsi_process_cq(struct be_eq_obj *pbe_eq)
>  
>  		cri_index = BE_GET_CRI_FROM_CID(cid);
>  		ep = phba->ep_array[cri_index];
> +		if (unlikely(ep == NULL)) {
> +			/* connection has already been freed
> +			 * just move on to next one
> +			 */
> +			beiscsi_log(phba, KERN_WARNING,
> +				    BEISCSI_LOG_INIT,
> +				    "BM_%d : proc cqe of disconn ep: cid %d\n",
> +				    cid);
> +			goto proc_next_cqe;
> +		}
>  		beiscsi_ep = ep->dd_data;
>  		beiscsi_conn = beiscsi_ep->conn;
>  

It looks like if that race is possible then we could also free the ep
while you are accessing right? I think you would need to get a ref to
the ep.

What command/function tells the card to stop sending the driver
events/notifications/ios for that connection? Is it beiscsi_close_conn
or mgmt_invalidate_connection?

  reply	other threads:[~2014-05-07 22:18 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-05-06  1:41 [PATCH 1/8] be2iscsi: Fix retrieving MCCQ_WRB in non-embedded Mbox path Jay Kallickal
2014-05-06  1:41 ` [PATCH 2/8] be2iscsi: Fix exposing Host in sysfs after adapter initialization is complete Jay Kallickal
2014-05-06  1:41 ` [PATCH 3/8] be2iscsi: Fix interrupt Coalescing mechanism Jay Kallickal
2014-05-06  1:41 ` [PATCH 4/8] be2iscsi: Fix TCP parameters while connection offloading Jay Kallickal
2014-05-06  1:41 ` [PATCH 5/8] be2iscsi: Fix memory corruption in MBX path Jay Kallickal
2014-05-06  1:41 ` [PATCH 6/8] be2iscsi: Fix destroy MCC-CQ before MCC-EQ is destroyed Jay Kallickal
2014-05-06  1:41 ` [PATCH 7/8] be2iscsi: Fix processing cqe for cxn whose endpoint is freed Jay Kallickal
2014-05-07 22:18   ` Mike Christie [this message]
2014-05-28 15:51     ` Christoph Hellwig
2014-06-02  5:52     ` Sony John-N
2014-06-02  6:46       ` Christoph Hellwig
2014-06-02 19:22         ` James Bottomley
2014-06-02 19:33           ` hch
2014-06-02 20:02             ` James Bottomley
2014-06-02 20:05             ` Linus Torvalds
2014-06-02 20:08               ` hch
2014-06-02 20:24                 ` Linus Torvalds
2014-06-02 20:32                   ` hch
2014-05-06  1:41 ` [PATCH 8/8] be2iscsi: Bump the driver version Jay Kallickal
2014-05-06  1:41 ` [PATCH 0/8] be2iscsi: update to 10.2.273.0 Jay Kallickal

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=536AB13E.6080906@cs.wisc.edu \
    --to=michaelc@cs.wisc.edu \
    --cc=jayamohan.kallickal@emulex.com \
    --cc=jayamohank@gmail.com \
    --cc=jbottomley@parallels.com \
    --cc=linux-scsi@vger.kernel.org \
    --cc=minhduc.tran@emulex.com \
    --cc=sony.john-n@emulex.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.