[ofa-general] Re: [PATCH] IB/core: handle race between elements in qork queues after event

Roland Dreier rdreier at cisco.com
Wed Apr 30 08:07:23 PDT 2008


 > This patch solves a race between elements in work queues that are 
 > carried out after an event occurs. When SM address handle becomes i
 > nvalid and needs an update it is set to NULL and until update_sm_ah() 
 > is called, any request that needs sm_ah is replied with -EAGAIN return 
 > status.

What is the race?  What is the effect of the race?  Don't expect me to
be psychic and guess what you're fixing.  And if there is more
information in an email thread or bugzilla entry, please include a link
to it.

Can this race between work queue entries be solved in a simpler way just
by using a single-threaded workqueue?

Your patch doesn't seem to change any consumers of this code.  How do
they cope with a -EAGAIN return value?

 >  static void ib_sa_event(struct ib_event_handler *handler, struct ib_event *event)
 >  {
 > +
 >  	if (event->event == IB_EVENT_PORT_ERR    ||

No need to add a blank line here.

 > +	if (!port->sm_ah) {
 > +		return  -EAGAIN;
 > +	}

No need for braces here.

 > +	agent = port->agent;
 > +	
 >  	query = kmalloc(sizeof *query, gfp_mask);

blank line has trailing whitespace.

Please investigate using checkpatch.pl.

 - R.



More information about the general mailing list