lkml.org 
[lkml]   [2018]   [Oct]   [7]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [PATCH RFC 0/5] rcu doc updates for whatisRCU and checklist
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

\
 
 \ /
  Last update: 2018-10-07 00:49    [W:0.344 / U:0.260 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site