lkml.org 
[lkml]   [2009]   [Mar]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    /
    Date
    From
    SubjectRe: [PATCH 3/5] tracing/ftrace: check if debugfs is registered before creating files

    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.

    -- Steve



    \
     
     \ /
      Last update: 2009-03-23 20:21    [W:0.023 / U:31.220 seconds]
    ©2003-2016 Jasper Spaans. hosted at Digital OceanAdvertise on this site