[ofa-general] Re: [PATCH 08/10] RDMA/nes: Change accept_pend_cnt to atomic

Roland Dreier rdreier at cisco.com
Mon Nov 24 13:59:43 PST 2008


 > There is a race condition on accept_pend_cnt.  Change it to atomic.

This is much too terse, so I don't know what the race is or how the
patch fixes it.  But...

 > +	if (atomic_dec_and_test(&cm_node->accept_pend)) {

you do atomic_dec_and_test() but then the only other manipulations of
accept_pend that I see are:

 > +	atomic_set(&cm_node->accept_pend, 0);
 > +		atomic_set(&cm_node->accept_pend, 1);

and there's no particular ordering between atomic_set() and
atomic_dec_and_test() that I know of to protect against races.

So at least a better desription of the patch, please.

 - R.



More information about the general mailing list