[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20240103212506.41432d12@gandalf.local.home>
Date: Wed, 3 Jan 2024 21:25:06 -0500
From: Steven Rostedt <rostedt@...dmis.org>
To: Al Viro <viro@...iv.linux.org.uk>
Cc: LKML <linux-kernel@...r.kernel.org>, Linux Trace Kernel
<linux-trace-kernel@...r.kernel.org>, Masami Hiramatsu
<mhiramat@...nel.org>, Mathieu Desnoyers <mathieu.desnoyers@...icios.com>,
Linus Torvalds <torvalds@...ux-foundation.org>, Christian Brauner
<brauner@...nel.org>, linux-fsdevel@...r.kernel.org, Greg Kroah-Hartman
<gregkh@...uxfoundation.org>
Subject: Re: [PATCH] tracefs/eventfs: Use root and instance inodes as
default ownership
On Thu, 4 Jan 2024 01:48:37 +0000
Al Viro <viro@...iv.linux.org.uk> wrote:
> 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...
That was more of thinking that the dentry and dentry->d_parent are
different. As dentry is part of eventfs and dentry->d_parent is part of
tracefs. Currently they both have the same superblock so yeah, I could just
write it that way too and it would work. But in my head, I was thinking
that they behave differently and maybe one day eventfs would get its own
superblock which would not work.
To explain this better:
/sys/kernel/tracing/ is the parent of /sys/kernel/tracing/events
But everything but "events" in /sys/kernel/tracing/* is part of tracefs.
Everything in /sys/kernel/tracing/events is part of eventfs.
That was my thought process. But as both tracefs and eventfs still use
tracefs_get_inode(), it would work as you state.
I'll update that, as I don't foresee that eventfs will become its own file
system.
Thanks,
-- Steve
Powered by blists - more mailing lists