All of lore.kernel.org
 help / color / mirror / Atom feed
From: Bart Van Assche <bvanassche-HInyCGIudOg@public.gmane.org>
To: dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org
Cc: dillowda-1Heg1YXhbW8@public.gmane.org,
	roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org,
	sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org,
	hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org,
	JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org,
	linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org,
	Sebastian Riemer
	<sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
Subject: Re: [PATCH 2/5] ib_srp: removed superfluous warning in send timeout case
Date: Sat, 01 Sep 2012 07:44:02 +0000	[thread overview]
Message-ID: <5041BCC2.8010309@acm.org> (raw)
In-Reply-To: <1346443241-24844-3-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>

On 08/31/12 20:00, dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org wrote:
> From: Dongsu Park <dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
> 
> Signed-off-By: Sebastian Riemer <sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
> ---
>  drivers/infiniband/ulp/srp/ib_srp.c | 1 -
>  1 file changed, 1 deletion(-)
> 
> diff --git a/drivers/infiniband/ulp/srp/ib_srp.c b/drivers/infiniband/ulp/srp/ib_srp.c
> index a0d0ca2..1b274484 100644
> --- a/drivers/infiniband/ulp/srp/ib_srp.c
> +++ b/drivers/infiniband/ulp/srp/ib_srp.c
> @@ -534,7 +534,6 @@ static void srp_wait_last_send_wqe(struct srp_target_port *target)
>  		msleep(20);
>  	}
>  
> -	WARN_ON(!target->last_send_wqe);
>  }
>  
>  static void srp_disconnect_target(struct srp_target_port *target)

The purpose of the functions srp_wait_last_recv_wqe() and
srp_wait_last_send_wqe() is to wait until the IB HCA has finished
delivering work completions to ib_srp. The InfiniBand Architecture
Manual specifies how long that can take. If the above WARN_ON()
statement is hit it means that it took longer than expected before all
pending work was completed. Letting srp_wait_last_send_wqe() return
before all pending work has been completed is dangerous because that may
trigger a use-after-free in the code that calls that function. So we
have to dig deeper here and find out why that WARN_ON() statement was hit.

Bart.
--
To unsubscribe from this list: send the line "unsubscribe linux-rdma" in
the body of a message to majordomo-u79uwXL29TY76Z2rM5mHXA@public.gmane.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

  parent reply	other threads:[~2012-09-01  7:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2012-08-31 20:00 [PATCH 0/5] Fix bugs in ib_srp patches for H.A. purposes dongsu.park-EIkl63zCoXaH+58JC4qpiA
2012-08-31 20:00 ` dongsu.park
2012-08-31 20:00 ` [PATCH 1/5] ib_srp: free memory correctly in srp_free_iu() dongsu.park
     [not found]   ` <1346443241-24844-2-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:32     ` Bart Van Assche
2012-08-31 20:00 ` [PATCH 2/5] ib_srp: removed superfluous warning in send timeout case dongsu.park
     [not found]   ` <1346443241-24844-3-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:44     ` Bart Van Assche [this message]
2012-08-31 20:00 ` [PATCH 3/5] ib_srp: hold a mutex when adding a new target port dongsu.park
     [not found]   ` <1346443241-24844-4-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:55     ` Bart Van Assche
2012-08-31 20:00 ` [PATCH 4/5] ib_srp: check if rport->lld_data is NULL before removing rport dongsu.park
     [not found]   ` <1346443241-24844-5-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-09-01  7:59     ` Bart Van Assche
     [not found] ` <1346443241-24844-1-git-send-email-dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org>
2012-08-31 20:00   ` [PATCH 5/5] ib_srp: fix an error accessing invalid memory in rport_dev_loss_timedout dongsu.park-EIkl63zCoXaH+58JC4qpiA
2012-08-31 20:00     ` dongsu.park
2012-09-01  8:09   ` [PATCH 0/5] Fix bugs in ib_srp patches for H.A. purposes Bart Van Assche
2012-09-01  8:09     ` Bart Van Assche

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=5041BCC2.8010309@acm.org \
    --to=bvanassche-hinycgiudog@public.gmane.org \
    --cc=JBottomley-bzQdu9zFT3WakBO8gow8eQ@public.gmane.org \
    --cc=dillowda-1Heg1YXhbW8@public.gmane.org \
    --cc=dongsu.park-EIkl63zCoXaH+58JC4qpiA@public.gmane.org \
    --cc=hal.rosenstock-Re5JQEeQqe8AvxtiuMwx3w@public.gmane.org \
    --cc=linux-rdma-u79uwXL29TY76Z2rM5mHXA@public.gmane.org \
    --cc=roland-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org \
    --cc=sean.hefty-ral2JQCrhuEAvxtiuMwx3w@public.gmane.org \
    --cc=sebastian.riemer-EIkl63zCoXaH+58JC4qpiA@public.gmane.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 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.