Re: [PATCH] tracefs/eventfs: Use root and instance inodes as default ownership

From: Al Viro
Date: Wed Jan 03 2024 - 20:48:52 EST


On Wed, Jan 03, 2024 at 08:32:46PM -0500, Steven Rostedt wrote:

> + /* Get the tracefs root from the parent */
> + inode = d_inode(dentry->d_parent);
> + inode = d_inode(inode->i_sb->s_root);

That makes no sense. First of all, for any positive dentry we have
dentry->d_sb == dentry->d_inode->i_sb. And it's the same for all
dentries on given superblock. So what's the point of that dance?
If you want the root inode, just go for d_inode(dentry->d_sb->s_root)
and be done with that...