]> Git Repo - linux.git/commitdiff
tracefs/eventfs: Use list_for_each_srcu() in dcache_dir_open_wrapper()
authorSteven Rostedt (Google) <[email protected]>
Tue, 12 Sep 2023 00:06:54 +0000 (20:06 -0400)
committerSteven Rostedt (Google) <[email protected]>
Tue, 12 Sep 2023 02:05:02 +0000 (22:05 -0400)
The eventfs files list is protected by SRCU. In earlier iterations it was
protected with just RCU, but because it needed to also call sleepable
code, it had to be switch to SRCU. The dcache_dir_open_wrapper()
list_for_each_rcu() was missed and did not get converted over to
list_for_each_srcu(). That needs to be fixed.

Link: https://lore.kernel.org/linux-trace-kernel/[email protected]/
Link: https://lore.kernel.org/linux-trace-kernel/[email protected]
Cc: Mark Rutland <[email protected]>
Cc: Ajay Kaher <[email protected]>
Cc: "Paul E. McKenney" <[email protected]>
Reported-by: Masami Hiramatsu (Google) <[email protected]>
Fixes: 63940449555e7 ("eventfs: Implement eventfs lookup, read, open functions")
Signed-off-by: Steven Rostedt (Google) <[email protected]>
fs/tracefs/event_inode.c

index f168aca4545870d4bce71a4a485a24d3c63bd48d..9f64e73327968edc286eaaa847249a4115fa2d49 100644 (file)
@@ -452,7 +452,8 @@ static int dcache_dir_open_wrapper(struct inode *inode, struct file *file)
 
        ei = ti->private;
        idx = srcu_read_lock(&eventfs_srcu);
-       list_for_each_entry_rcu(ef, &ei->e_top_files, list) {
+       list_for_each_entry_srcu(ef, &ei->e_top_files, list,
+                                srcu_read_lock_held(&eventfs_srcu)) {
                create_dentry(ef, dentry, false);
        }
        srcu_read_unlock(&eventfs_srcu, idx);
This page took 0.060619 seconds and 4 git commands to generate.