diff mbox

[2/5] ib_srp: removed superfluous warning in send timeout case

Message ID 1346443241-24844-3-git-send-email-dongsu.park@profitbricks.com (mailing list archive)
State Awaiting Upstream
Headers show

Commit Message

Dongsu Park Aug. 31, 2012, 8 p.m. UTC
From: Dongsu Park <dongsu.park@profitbricks.com>

Signed-off-By: Sebastian Riemer <sebastian.riemer@profitbricks.com>
---
 drivers/infiniband/ulp/srp/ib_srp.c | 1 -
 1 file changed, 1 deletion(-)

Comments

Bart Van Assche Sept. 1, 2012, 7:44 a.m. UTC | #1
On 08/31/12 20:00, dongsu.park@profitbricks.com wrote:
> From: Dongsu Park <dongsu.park@profitbricks.com>
> 
> Signed-off-By: Sebastian Riemer <sebastian.riemer@profitbricks.com>
> ---
>  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@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

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)