diff options
author | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-04 13:58:24 -0800 |
---|---|---|
committer | Linus Torvalds <torvalds@linux-foundation.org> | 2009-02-04 13:58:24 -0800 |
commit | 9f96ae6ee049b78dc334965a38fb441f7a16201f (patch) | |
tree | cf13468728ec5ac5895b3b15b33937b2bb765076 | |
parent | 9dfea1b46d9f147478ccdfa4a4ef472fdc98d6dd (diff) | |
parent | 229c4ef8ae56d69f8dec64533bf1c7f8070c1a4a (diff) |
Merge branch 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip
* 'tracing-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
ftrace: do_each_pid_task() needs rcu lock
-rw-r--r-- | kernel/trace/ftrace.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/kernel/trace/ftrace.c b/kernel/trace/ftrace.c index 7dcf6e9f2b0..9a236ffe2aa 100644 --- a/kernel/trace/ftrace.c +++ b/kernel/trace/ftrace.c @@ -1737,9 +1737,12 @@ static void clear_ftrace_pid(struct pid *pid) { struct task_struct *p; + rcu_read_lock(); do_each_pid_task(pid, PIDTYPE_PID, p) { clear_tsk_trace_trace(p); } while_each_pid_task(pid, PIDTYPE_PID, p); + rcu_read_unlock(); + put_pid(pid); } @@ -1747,9 +1750,11 @@ static void set_ftrace_pid(struct pid *pid) { struct task_struct *p; + rcu_read_lock(); do_each_pid_task(pid, PIDTYPE_PID, p) { set_tsk_trace_trace(p); } while_each_pid_task(pid, PIDTYPE_PID, p); + rcu_read_unlock(); } static void clear_ftrace_pid_task(struct pid **pid) |