Skip to content

Commit 22e61e1

Browse files
committed
eventfs: Do not treat events directory different than other directories
Treat the events directory the same as other directories when it comes to permissions. The events directory was considered different because it's dentry is persistent, whereas the other directory dentries are created when accessed. But the way tracefs now does its ownership by using the root dentry's permissions as the default permissions, the events directory can get out of sync when a remount is performed setting the group and user permissions. Remove the special case for the events directory on setting the attributes. This allows the updates caused by remount to work properly as well as simplifies the code. Link: https://lore.kernel.org/linux-trace-kernel/[email protected] Cc: [email protected] Cc: Masami Hiramatsu <[email protected]> Cc: Mark Rutland <[email protected]> Cc: Mathieu Desnoyers <[email protected]> Cc: Andrew Morton <[email protected]> Fixes: 8186fff ("tracefs/eventfs: Use root and instance inodes as default ownership") Signed-off-by: Steven Rostedt (Google) <[email protected]>
1 parent d53891d commit 22e61e1

File tree

1 file changed

+1
-15
lines changed

1 file changed

+1
-15
lines changed

fs/tracefs/event_inode.c

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -206,21 +206,7 @@ static int eventfs_set_attr(struct mnt_idmap *idmap, struct dentry *dentry,
206206
* determined by the parent directory.
207207
*/
208208
if (dentry->d_inode->i_mode & S_IFDIR) {
209-
/*
210-
* The events directory dentry is never freed, unless its
211-
* part of an instance that is deleted. It's attr is the
212-
* default for its child files and directories.
213-
* Do not update it. It's not used for its own mode or ownership.
214-
*/
215-
if (ei->is_events) {
216-
/* But it still needs to know if it was modified */
217-
if (iattr->ia_valid & ATTR_UID)
218-
ei->attr.mode |= EVENTFS_SAVE_UID;
219-
if (iattr->ia_valid & ATTR_GID)
220-
ei->attr.mode |= EVENTFS_SAVE_GID;
221-
} else {
222-
update_attr(&ei->attr, iattr);
223-
}
209+
update_attr(&ei->attr, iattr);
224210

225211
} else {
226212
name = dentry->d_name.name;

0 commit comments

Comments
 (0)