[lkml]   [2013]   [Aug]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
Patch in this message
Subject[ 18/99] tracing: Fix error handling to ensure instances can always be removed
3.10-stable review patch.  If anyone has any objections, please let me know.


From: Alexander Z Lam <>

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


Signed-off-by: Alexander Z Lam <>
Cc: Vaibhav Nagarnaik <>
Cc: David Sharp <>
Cc: Alexander Z Lam <>
Signed-off-by: Steven Rostedt <>
Signed-off-by: Greg Kroah-Hartman <>

kernel/trace/trace.c | 4 +++-
1 file changed, 3 insertions(+), 1 deletion(-)

--- a/kernel/trace/trace.c
+++ b/kernel/trace/trace.c
@@ -5926,8 +5926,10 @@ static int new_instance_create(const cha
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-08-02 12:21    [W:0.367 / U:1.504 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site