Skip to contentSkip to conversation

tracing: A couple more fixes

PATCH New Steven Rostedt 1 participant 3 messages Jul 20, 2013

Subsystems (2)
lore
Share & tools
lore
author maintainer
#2 lore raw

PATCH 2/2 tracing: Kill the unbalanced tr->ref++ in tracing_buffers_open()

In reply to Steven Rostedt

From: Oleg Nesterov <[email protected]>

tracing_buffers_open() does trace_array_get() and then it wrongly inrcements tr->ref again under trace_types_lock. This means that every caller leaks trace_array:

	# cd /sys/kernel/debug/tracing/
	# mkdir instances/X
	# true < instances/X/per_cpu/cpu0/trace_pipe_raw
	# rmdir instances/X
	rmdir: failed to remove `instances/X': Device or resource busy
Cc Ingo Molnar <[email protected]>
Cc Frederic Weisbecker <[email protected]>
Cc Masami Hiramatsu <[email protected]>
---
 kernel/trace/trace.c |    2 --
 1 file changed, 2 deletions(-)
kernel/trace/trace.c +0 -2
index 7d9ceab..3f24777 100644
@@ -4959,8 +4959,6 @@ static int tracing_buffers_open(struct inode *inode, struct file *filp)
 
 	mutex_lock(&trace_types_lock);
 
-	tr->ref++;
-
 	info->iter.tr		= tr;
 	info->iter.cpu_file	= tc->cpu;
 	info->iter.trace	= tr->current_trace;
Signature · 1 line
1.7.10.4
author maintainer
#1 lore raw

PATCH 1/2 tracing: Kill trace_array->waiter

In reply to Steven Rostedt

From: Oleg Nesterov <[email protected]>

Trivial. trace_array->waiter has no users since 6eaaa5d5 "tracing/core: use appropriate waiting on trace_pipe".

---
 kernel/trace/trace.h |    1 -
 1 file changed, 1 deletion(-)
kernel/trace/trace.h +0 -1
index 57b7bb0..e7d643b 100644
@@ -214,7 +214,6 @@ struct trace_array {
 	struct dentry		*event_dir;
 	struct list_head	systems;
 	struct list_head	events;
-	struct task_struct	*waiter;
 	int			ref;
 };
 
Signature · 1 line
1.7.10.4

Steven Rostedt

author maintainer
#0 lore raw

cover tracing: A couple more fixes

Oleg sent me a couple more fixes. Pushing them into my for-next branch. Monday I'll push to Linus.

-- Steve

git://git.kernel.org/pub/scm/linux/kernel/git/rostedt/linux-trace.git
for-next

Head SHA1: e70e78e3c83b536730e31231dd9b979768d8df3c 1bb539ca36e21c2f4fce0865e11df384bc7b7656

Oleg Nesterov (2):

      tracing: Kill trace_array->waiter
      tracing: Kill the unbalanced tr->ref++ in tracing_buffers_open()

----

 kernel/trace/trace.c |    2 --
 kernel/trace/trace.h |    1 -
 2 files changed, 3 deletions(-)