Re: [PATCH RFC 0/5] rcu doc updates for whatisRCU and checklist

From: Theodore Y. Ts'o
Date: Sat Oct 06 2018 - 18:47:43 EST


On Fri, Oct 05, 2018 at 09:40:57PM -0700, Joel Fernandes wrote:
>
> Could you annotate this pointer (sbi->s_qf_names) with __rcu so it can be
> checked by sparse for proper usage? Its also point #16 in the checklist.txt
> RCU document. I enclosed a diff to do this below.

Sure.

> I also saw a bunch of places in super.c where the pointer isn't accessed from
> an rcu read section or rcu_dereference, but it was a quick look so sorry if I
> missed something. If its true, then are you planning to convert these to use
> rcu_dereference and wrapped by an rcu_read_lock/unlock as well?

These are places where we are holding s_umount, so there's no way
s_qf_names can change out from under us. So the conversion should be
to use rcu_dereference_protected().

> > + to_free[i] = rcu_dereference_protected(sbi->s_qf_names[i],
> > + &sb->s_umount);
>
> Also should this be the following?
> to_free[i] = rcu_dereference_protected(sbi->s_qf_names[i],
> lockdep_is_held(&sb->s_umount));

Yep, good catch, thanks.

- Ted