[openib-general] [PATCH fixed] was Re: [PATCH] ipoib_multicast/ipoib_mcast_send race

Michael S. Tsirkin mst at mellanox.co.il
Sun Dec 11 22:12:13 PST 2005


Quoting Krishna Kumar2 <krkumar2 at in.ibm.com>:
> Subject: Re: [openib-general] [PATCH fixed] was Re: [PATCH]?ipoib_multicast/ipoib_mcast_send race
> 
> 
> Hi Micheal, 
> 
> But the lock doesn't help that case. The only difference with having the
> 
> lock is that in case of a race, the mcast_send() will complete *before* 
> the flag is set, while without the lock the mcast_send() could be in the
> 
> *middle* of execution when the flag is set.

Exactly, you got it. If you look at mcast_send you'll see that it creates new
queries, creates broad cast group and adds entries to the list.

So here's why the lock helps:

> > > > > Fix the following race scenario:
> > > > > device is up.
> > > > > port event or set mcast list triggers ipoib_mcast_stop_thread, 
> > > > > This cancels the query and waits on mcast "done" completion.
> > > > > completion is called and "done" is set.
> > > > > Meanwhile, ipoib_mcast_send arrives and starts a new query,
> > > > > re-initializing "done".

Clear now?

-- 
MST



More information about the general mailing list