From: Steven Rostedt <rostedt@goodmis.org>
To: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Cc: linux-kernel@vger.kernel.org, Al Viro <viro@ZenIV.linux.org.uk>,
Ingo Molnar <mingo@kernel.org>,
Andrew Morton <akpm@linux-foundation.org>
Subject: Re: [PATCH 3/5 v2] tracing: Automatically mount tracefs on debugfs/tracing
Date: Sat, 24 Jan 2015 06:33:30 -0500 [thread overview]
Message-ID: <20150124063330.2c986ea2@grimm.local.home> (raw)
In-Reply-To: <20150124030041.GB5009@kroah.com>
On Sat, 24 Jan 2015 11:00:41 +0800
Greg Kroah-Hartman <gregkh@linuxfoundation.org> wrote:
> > + if (traced->d_op) {
> > + /*
> > + * FIXME:
> > + * Currently debugfs sets the d_op by a
> > side-effect
> > + * of calling simple_lookup(). Normally,
> > we should
> > + * never change d_op of a dentry, but as
> > this is
> > + * happening at boot up and shouldn't be
> > racing with
> > + * any other users, this should be OK. But
> > it is still
> > + * a hack, and needs to be properly done.
> > + */
> > + trace_ops = *traced->d_op;
> > + trace_ops.d_automount = trace_automount;
> > + traced->d_flags |= DCACHE_NEED_AUTOMOUNT;
> > + traced->d_op = &trace_ops;
> > + } else {
> > + /* Ideally, this is what should happen */
> > + trace_ops = simple_dentry_operations;
> > + trace_ops.d_automount = trace_automount;
> > + d_set_d_op(traced, &trace_ops);
>
> How will this else block run if debugfs is setting d_op in the
> debugfs_create_dir() call?
It wont; I put the else block there to show what we would like to do.
And would hopefully work if debugfs ever changed.
>
> What really do you want to do here, just automount a filesystem on
> debugfs? If so, can't we just add a new debugfs call to do that?
We could add a call to debugfs to do that. Would you prefer that? From
talking with Al, it sounds to me that changing d_ops on the fly is very
racy. Adding a call in debugfs sounds like it would be open for other
users to do the same and do so while the system is running. Would that
be wise?
Doing the automount here is guaranteed not to happen after system boot
up, or when there might be users of debugfs while the ops changes.
-- Steve
-- Steve
next prev parent reply other threads:[~2015-01-24 11:33 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-01-23 15:55 [PATCH 0/5 v2] tracing: Add new file system tracefs Steven Rostedt
2015-01-23 15:55 ` [PATCH 1/5 v2] tracefs: Add new tracefs file system Steven Rostedt
2015-01-23 15:55 ` [PATCH 2/5 v2] tracing: Convert the tracing facility over to use tracefs Steven Rostedt
2015-01-23 15:55 ` [PATCH 3/5 v2] tracing: Automatically mount tracefs on debugfs/tracing Steven Rostedt
2015-01-24 3:00 ` Greg Kroah-Hartman
2015-01-24 11:33 ` Steven Rostedt [this message]
2015-01-25 13:22 ` Greg Kroah-Hartman
2015-01-25 19:38 ` Steven Rostedt
2015-01-25 19:59 ` Al Viro
2015-01-25 20:27 ` Al Viro
2015-01-25 20:31 ` Al Viro
2015-01-23 15:55 ` [PATCH 4/5 v2] tracefs: Add directory /sys/kernel/tracing Steven Rostedt
2015-01-24 3:00 ` Greg Kroah-Hartman
2015-01-23 15:55 ` [PATCH 5/5 v2] tracing: Have mkdir and rmdir be part of tracefs Steven Rostedt
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150124063330.2c986ea2@grimm.local.home \
--to=rostedt@goodmis.org \
--cc=akpm@linux-foundation.org \
--cc=gregkh@linuxfoundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mingo@kernel.org \
--cc=viro@ZenIV.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).