Messages in this thread | | | Subject | RE: [PATCH] rcu: fix a race in hlist_nulls_for_each_entry_rcu macro | Date | Tue, 21 May 2013 14:42:34 +0100 | From | "David Laight" <> |
| |
> >> -#define hlist_nulls_first_rcu(head) \ > >> - (*((struct hlist_nulls_node __rcu __force **)&(head)->first)) > >> +#define hlist_nulls_first_rcu(head) \ > >> + (*((struct hlist_nulls_node __rcu __force **) \ > >> + &((volatile typeof(*head) *)head)->first)) > > > > I'd have thought it would be better to change hlist_nulls_first_rcu(). > > It's exactly what I suggest. May be I miss something? Please, clarify.
Gah - chasing through too many defines in too many header files! Actually making the 'head' structure have volatile pointers might be better. Possibly in struct hlist_nulls_node itself. There are toooo many casts for sanity :-)
David
| |