diff options
author | Alexander Z Lam <azl@google.com> | 2013-07-10 20:34:34 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2013-08-04 04:50:41 -0400 |
commit | a33eb1f5e1ae58418d9853c794a40d340605d752 (patch) | |
tree | e56959f00952e8a7599b1de8c8005b4cb240dc5f | |
parent | 25ef812609dbc1a3db74f0f5912c94afdfd65d31 (diff) |
tracing: Fix error handling to ensure instances can always be removed
commit 609e85a70bcd0eedf4ec60639dbcfb1ab011e054 upstream.
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.
Link: http://lkml.kernel.org/r/1373502874-1706-2-git-send-email-azl@google.com
Signed-off-by: Alexander Z Lam <azl@google.com>
Cc: Vaibhav Nagarnaik <vnagarnaik@google.com>
Cc: David Sharp <dhsharp@google.com>
Cc: Alexander Z Lam <lambchop468@gmail.com>
Signed-off-by: Steven Rostedt <rostedt@goodmis.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | kernel/trace/trace.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/kernel/trace/trace.c b/kernel/trace/trace.c index 0b936d806659..9109d60e2f29 100644 --- a/kernel/trace/trace.c +++ b/kernel/trace/trace.c | |||
@@ -5926,8 +5926,10 @@ static int new_instance_create(const char *name) | |||
5926 | goto out_free_tr; | 5926 | goto out_free_tr; |
5927 | 5927 | ||
5928 | ret = event_trace_add_tracer(tr->dir, tr); | 5928 | ret = event_trace_add_tracer(tr->dir, tr); |
5929 | if (ret) | 5929 | if (ret) { |
5930 | debugfs_remove_recursive(tr->dir); | ||
5930 | goto out_free_tr; | 5931 | goto out_free_tr; |
5932 | } | ||
5931 | 5933 | ||
5932 | init_tracer_debugfs(tr, tr->dir); | 5934 | init_tracer_debugfs(tr, tr->dir); |
5933 | 5935 | ||