public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Ingo Molnar <mingo@elte.hu>
To: Steven Rostedt <rostedt@goodmis.org>
Cc: Frederic Weisbecker <fweisbec@gmail.com>,
	LKML <linux-kernel@vger.kernel.org>,
	Greg Kroah-Hartman <gregkh@suse.de>
Subject: Re: [PATCH 3/5] tracing/ftrace: check if debugfs is registered before creating files
Date: Mon, 23 Mar 2009 20:22:12 +0100	[thread overview]
Message-ID: <20090323192212.GA23842@elte.hu> (raw)
In-Reply-To: <alpine.DEB.2.00.0903231517410.3578@gandalf.stny.rr.com>


* Steven Rostedt <rostedt@goodmis.org> wrote:

> 
> On Sun, 22 Mar 2009, Frederic Weisbecker wrote:
> 
> > Impact: fix a crash with ftrace={nop,boot} parameter
> > 
> > If the nop or initcall tracers are launched as boot tracers,
> > they will attempt to create their option directory and files.
> > But these tracers are registered very early and then assigned
> > as "boot tracers" very early if asked to.
> > 
> > Since they do this before debugfs has been registered (core initcall),
> > a crash is triggered.
> > 
> > Another early tracers could also come later. So we fix it by
> > checking if debugfs is initialized before creating the root
> > tracing directory.
> > 
> > Cc: Greg Kroah-Hartman <gregkh@suse.de>
> > Signed-off-by: Frederic Weisbecker <fweisbec@gmail.com>
> > ---
> >  kernel/trace/trace.c |    3 +++
> >  1 files changed, 3 insertions(+), 0 deletions(-)
> > 
> > diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> > index ace685c..f0e1337 100644
> > --- a/kernel/trace/trace.c
> > +++ b/kernel/trace/trace.c
> > @@ -3513,6 +3513,9 @@ struct dentry *tracing_init_dentry(void)
> >  	if (d_tracer)
> >  		return d_tracer;
> >  
> > +	if (!debugfs_initialized())
> > +		return NULL;
> > +
> >  	d_tracer = debugfs_create_dir("tracing", NULL);
> >  
> 
> Hmm, those tracers should separate out the debugfs code, and put 
> it into a fs_initcall(), where debugfs should already initialized.

indeed, this seems much cleaner and we'll have the debugfs 
structures initialized as well.

	Ingo

  reply	other threads:[~2009-03-23 19:22 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2009-03-22 22:10 [PATCH 1/5] tracing/events: make the filter files writable Frederic Weisbecker
2009-03-22 22:10 ` [PATCH 2/5] debugfs: function to know if debugfs is initialized Frederic Weisbecker
2009-03-23  8:18   ` Ingo Molnar
2009-03-23 14:41     ` Greg KH
2009-03-23 16:08       ` Ingo Molnar
2009-03-23 15:57   ` [tip:tracing/ftrace] " Frederic Weisbecker
2009-03-22 22:10 ` [PATCH 3/5] tracing/ftrace: check if debugfs is registered before creating files Frederic Weisbecker
2009-03-23  8:26   ` Ingo Molnar
2009-03-23 15:57   ` [tip:tracing/ftrace] " Frederic Weisbecker
2009-03-23 19:18   ` [PATCH 3/5] " Steven Rostedt
2009-03-23 19:22     ` Ingo Molnar [this message]
2009-03-23 19:47     ` Frederic Weisbecker
2009-03-22 22:10 ` [PATCH 4/5] tracing/events: don't use wake up for events Frederic Weisbecker
2009-03-23  8:30   ` [tip:tracing/filters] " Frederic Weisbecker
2009-03-23 19:21     ` Steven Rostedt
2009-03-23 19:33       ` Frederic Weisbecker
2009-03-22 22:10 ` [PATCH 5/5] tracing/ftrace: make nop using polling wait for events on pipe Frederic Weisbecker
2009-03-23  8:31   ` [tip:tracing/filters] tracing/ftrace: make nop-tracer use " Frederic Weisbecker
2009-03-22 22:12 ` [PATCH 1/5] tracing/events: make the filter files writable Frederic Weisbecker
2009-03-23  8:25 ` Ingo Molnar
2009-03-23  8:31   ` Frederic Weisbecker
2009-03-23  8:30 ` [tip:tracing/filters] " Frederic Weisbecker

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=20090323192212.GA23842@elte.hu \
    --to=mingo@elte.hu \
    --cc=fweisbec@gmail.com \
    --cc=gregkh@suse.de \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rostedt@goodmis.org \
    /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