Skip to content

Commit f67950b

Browse files
devnexenrostedt
authored andcommitted
eventfs: Use list_add_tail_rcu() for SRCU-protected children list
Commit d260327 ("eventfs: Use list_del_rcu() for SRCU protected list variable") converted the removal side to pair with the list_for_each_entry_srcu() walker in eventfs_iterate(). The insertion in eventfs_create_dir() was left as a plain list_add_tail(), which on weakly-ordered architectures can expose a new entry to the SRCU reader before its list pointers and fields are observable. Use list_add_tail_rcu() so the publication pairs with the existing list_del_rcu() and list_for_each_entry_srcu(). Fixes: 43aa6f9 ("eventfs: Get rid of dentry pointers without refcounts") Cc: [email protected] Link: https://patch.msgid.link/[email protected] Signed-off-by: David Carlier <[email protected]> Signed-off-by: Steven Rostedt <[email protected]>
1 parent 43cec30 commit f67950b

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

fs/tracefs/event_inode.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -706,7 +706,7 @@ struct eventfs_inode *eventfs_create_dir(const char *name, struct eventfs_inode
706706

707707
scoped_guard(mutex, &eventfs_mutex) {
708708
if (!parent->is_freed)
709-
list_add_tail(&ei->list, &parent->children);
709+
list_add_tail_rcu(&ei->list, &parent->children);
710710
}
711711
/* Was the parent freed? */
712712
if (list_empty(&ei->list)) {

0 commit comments

Comments
 (0)