Re: [PATCH] hlist_add_tail_rcu disable sparse warning

From: Steven Rostedt
Date: Mon Feb 27 2017 - 13:40:55 EST


On Fri, 10 Feb 2017 19:39:49 +0200
"Michael S. Tsirkin" <mst@xxxxxxxxxx> wrote:

> diff --git a/include/linux/rculist.h b/include/linux/rculist.h
> index 4f7a956..bf578e8 100644
> --- a/include/linux/rculist.h
> +++ b/include/linux/rculist.h
> @@ -509,7 +509,7 @@ static inline void hlist_add_tail_rcu(struct hlist_node *n,
> {
> struct hlist_node *i, *last = NULL;
>
> - for (i = hlist_first_rcu(h); i; i = hlist_next_rcu(i))
> + for (i = h->first; i; i = i->next)

Looks good to me, but I would probably add a comment above the loop
about this being in a write side section, and rcu conversions are not
needed.

Reviewed-by: Steven Rostedt (VMware) <rostedt@xxxxxxxxxxx>

-- Steve

> last = i;
>
> if (last) {