[openib-general] [PATCH/RFC] IB/mad: Fix race between cancel and receive

Roland Dreier rdreier at cisco.com
Tue Nov 7 10:52:15 PST 2006


OK, I'm testing this patch now.  Does this seem like a better fix (if
it works of course)?

diff --git a/drivers/infiniband/core/mad.c b/drivers/infiniband/core/mad.c
index 493f4c6..a72bcea 100644
--- a/drivers/infiniband/core/mad.c
+++ b/drivers/infiniband/core/mad.c
@@ -1750,7 +1750,7 @@ ib_find_send_mad(struct ib_mad_agent_pri
 		     */
 		    (is_direct(wc->recv_buf.mad->mad_hdr.mgmt_class) ||
 		     rcv_has_same_gid(mad_agent_priv, wr, wc)))
-			return wr;
+			return (wr->status == IB_WC_SUCCESS) ? wr : NULL;
 	}
 
 	/*




More information about the general mailing list