[git patch review 3/8] IPoIB: reinitialize mcast structs' completions for every query

From: Roland Dreier (rolandd_at_cisco.com)
Date: 11/30/05

  • Next message: Roland Dreier: "[git patch review 4/8] IPoIB: don't zero members after we allocate with kzalloc"
    Date:	Wed, 30 Nov 2005 00:57:25 +0000
    To: linux-kernel@vger.kernel.org, openib-general@openib.org
    
    

    Make sure mcast->done is initialized to uncompleted value before we
    submit a new query, so that it's safe to wait on.

    Signed-off-by: Michael S. Tsirkin <mst@mellanox.co.il>
    Signed-off-by: Roland Dreier <rolandd@cisco.com>

    ---
     drivers/infiniband/ulp/ipoib/ipoib_multicast.c |    6 ++++--
     1 files changed, 4 insertions(+), 2 deletions(-)
    applies-to: 993e77f7c00b7bc296e96f0cec1c98ea28a0436a
    de922487890936470660e89f9095aee980637989
    diff --git a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
    index c33ed87..10404e0 100644
    --- a/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
    +++ b/drivers/infiniband/ulp/ipoib/ipoib_multicast.c
    @@ -135,8 +135,6 @@ static struct ipoib_mcast *ipoib_mcast_a
     	if (!mcast)
     		return NULL;
     
    -	init_completion(&mcast->done);
    -
     	mcast->dev = dev;
     	mcast->created = jiffies;
     	mcast->backoff = 1;
    @@ -350,6 +348,8 @@ static int ipoib_mcast_sendonly_join(str
     	rec.port_gid = priv->local_gid;
     	rec.pkey     = cpu_to_be16(priv->pkey);
     
    +	init_completion(&mcast->done);
    +
     	ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec,
     				     IB_SA_MCMEMBER_REC_MGID		|
     				     IB_SA_MCMEMBER_REC_PORT_GID	|
    @@ -469,6 +469,8 @@ static void ipoib_mcast_join(struct net_
     		rec.traffic_class = priv->broadcast->mcmember.traffic_class;
     	}
     
    +	init_completion(&mcast->done);
    +
     	ret = ib_sa_mcmember_rec_set(priv->ca, priv->port, &rec, comp_mask,
     				     mcast->backoff * 1000, GFP_ATOMIC,
     				     ipoib_mcast_join_complete,
    ---
    0.99.9k
    -
    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to majordomo@vger.kernel.org
    More majordomo info at  http://vger.kernel.org/majordomo-info.html
    Please read the FAQ at  http://www.tux.org/lkml/
    

  • Next message: Roland Dreier: "[git patch review 4/8] IPoIB: don't zero members after we allocate with kzalloc"

    Relevant Pages

    • [DVB patch 36/48] frontends: kfree() cleanup
      ... kfreeis safe (Kenneth Aafloy) ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: Assuming NULL
      ... Jan Engelhardt writes: ... - in some places it's safe to assume non-NULL, ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [PATCH 2.4] Wireless Extension v16 : 802.11a/802.11g fixes
      ... On Thu, 4 Sep 2003, Jean Tourrilhes wrote: ... > safe as many people have tested it in 2.5.X and downloaded from my web ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • [PATCH] InfiniBand: remove unsafe use of in_atomic()
      ... safe. ... allocating with GFP_ATOMIC, since we don't know if we can sleep or not. ... send the line "unsubscribe linux-kernel" in ... Please read the FAQ at http://www.tux.org/lkml/ ...
      (Linux-Kernel)
    • Re: [patch] sched: fix scheduling latencies for !PREEMPT kernels
      ... I meant safe against deadlocks. ... > remove uses of the sleeping characteristic first, as in my mind that is ... > whatever tactic whoever cares to drive all this prefers. ... send the line "unsubscribe linux-kernel" in ...
      (Linux-Kernel)