Commit f67950b2 authored by David Carlier's avatar David Carlier Committed by Steven Rostedt
Browse files

eventfs: Use list_add_tail_rcu() for SRCU-protected children list

Commit d2603279 ("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: 43aa6f97 ("eventfs: Get rid of dentry pointers without refcounts")
Cc: stable@vger.kernel.org
Link: https://patch.msgid.link/20260418152251.199343-1-devnexen@gmail.com


Signed-off-by: default avatarDavid Carlier <devnexen@gmail.com>
Signed-off-by: default avatarSteven Rostedt <rostedt@goodmis.org>
parent 43cec30c
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -706,7 +706,7 @@ struct eventfs_inode *eventfs_create_dir(const char *name, struct eventfs_inode

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