lkml.org 
[lkml]   [2013]   [Jul]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 2/2] tracing: Fix error handling to ensure instances can always be removed
From
Date
On Wed, 2013-07-10 at 17:34 -0700, Alexander Z Lam wrote:
> Remove debugfs directories for tracing instances during creation if an error
> occurs causing the trace_array for that instance to not be added to
> ftrace_trace_arrays. If the directory continues to exist after the error, it
> cannot be removed because the respective trace_array is not in
> ftrace_trace_arrays.

This patch is fine, I'll put it in now.

Thanks,

-- Steve

>
> Cc: Vaibhav Nagarnaik <vnagarnaik@google.com>
> Cc: David Sharp <dhsharp@google.com>
> Cc: Alexander Z Lam <lambchop468@gmail.com>
> Signed-off-by: Alexander Z Lam <azl@google.com>
> ---
> kernel/trace/trace.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c
> index ca2743b..4ea9967 100644
> --- a/kernel/trace/trace.c
> +++ b/kernel/trace/trace.c
> @@ -5985,8 +5985,10 @@ static int new_instance_create(const char *name)
> goto out_free_tr;
>
> ret = event_trace_add_tracer(tr->dir, tr);
> - if (ret)
> + if (ret) {
> + debugfs_remove_recursive(tr->dir);
> goto out_free_tr;
> + }
>
> init_tracer_debugfs(tr, tr->dir);
>




\
 
 \ /
  Last update: 2013-07-18 19:21    [W:1.105 / U:0.408 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site