lkml.org 
[lkml]   [2013]   [Jan]   [22]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [RFC] Hack to use mkdir/rmdir in debugfs
From
Date
On Tue, 2013-01-22 at 23:44 -0500, Steven Rostedt wrote:

> + ret = event_trace_add_tracer(tr->dir, tr);
> + if (ret)
> + goto out_free_tr;
> +
> + init_tracer_debugfs(tr, tr->dir);
> +
> + mutex_unlock(&trace_types_lock);
> +
> + list_add(&tr->list, &ftrace_trace_arrays);

I just noticed this bug :-)

The list_add() needs to be inside the mutex protection. This code use to
be within the trace_new_instance_write(), and I just moved it into its
own function. Must have been where I screwed up.

-- Steve

> +
> + return 0;
> +
> + out_free_tr:
> + if (tr->buffer)
> + ring_buffer_free(tr->buffer);
> + kfree(tr->name);
> + kfree(tr);
> +
> + out_unlock:
> + mutex_unlock(&trace_types_lock);
> +
> + return ret;
> +
> +}
> +



\
 
 \ /
  Last update: 2013-01-23 06:21    [W:0.114 / U:0.352 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site