Skip to content

Commit 9243e54

Browse files
committed
tracefs/eventfs: Use list_for_each_srcu() in dcache_dir_open_wrapper()
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: 6394044 ("eventfs: Implement eventfs lookup, read, open functions") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent 62663b8 commit 9243e54

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

fs/tracefs/event_inode.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -452,7 +452,8 @@ static int dcache_dir_open_wrapper(struct inode *inode, struct file *file)
452452

453453
ei = ti->private;
454454
idx = srcu_read_lock(&eventfs_srcu);
455-
list_for_each_entry_rcu(ef, &ei->e_top_files, list) {
455+
list_for_each_entry_srcu(ef, &ei->e_top_files, list,
456+
srcu_read_lock_held(&eventfs_srcu)) {
456457
create_dentry(ef, dentry, false);
457458
}
458459
srcu_read_unlock(&eventfs_srcu, idx);

0 commit comments

Comments
 (0)