linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 1/2] trace_events_filter: use rcu_assign_pointer() when setting ftrace_event_call->filter
@ 2011-11-23  1:46 Tejun Heo
  2011-11-23  2:00 ` [PATCH 2/2] trace_event_filter: factorize filter creation Tejun Heo
                   ` (3 more replies)
  0 siblings, 4 replies; 21+ messages in thread
From: Tejun Heo @ 2011-11-23  1:46 UTC (permalink / raw)
  To: Steven Rostedt, Frederic Weisbecker, Ingo Molnar, Jiri Olsa; +Cc: linux-kernel

ftrace_event_call->filter is sched RCU protected but didn't use
rcu_assign_pointer().  Fix it.

TODO: Add proper __rcu annotation to call->filter and all its users.

Signed-off-by: Tejun Heo <tj@kernel.org>
---
 kernel/trace/trace_events_filter.c |    6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

Index: work/kernel/trace/trace_events_filter.c
===================================================================
--- work.orig/kernel/trace/trace_events_filter.c
+++ work/kernel/trace/trace_events_filter.c
@@ -1686,7 +1686,7 @@ static int replace_system_preds(struct e
 		 * replace the filter for the call.
 		 */
 		filter = call->filter;
-		call->filter = filter_item->filter;
+		rcu_assign_pointer(call->filter, filter_item->filter);
 		filter_item->filter = filter;
 
 		fail = false;
@@ -1741,7 +1741,7 @@ int apply_event_filter(struct ftrace_eve
 		filter = call->filter;
 		if (!filter)
 			goto out_unlock;
-		call->filter = NULL;
+		rcu_assign_pointer(call->filter, NULL);
 		/* Make sure the filter is not being used */
 		synchronize_sched();
 		__free_filter(filter);
@@ -1782,7 +1782,7 @@ out:
 	 * string
 	 */
 	tmp = call->filter;
-	call->filter = filter;
+	rcu_assign_pointer(call->filter, filter);
 	if (tmp) {
 		/* Make sure the call is done with the filter */
 		synchronize_sched();

^ permalink raw reply	[flat|nested] 21+ messages in thread

end of thread, other threads:[~2011-12-09 19:44 UTC | newest]

Thread overview: 21+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-11-23  1:46 [PATCH 1/2] trace_events_filter: use rcu_assign_pointer() when setting ftrace_event_call->filter Tejun Heo
2011-11-23  2:00 ` [PATCH 2/2] trace_event_filter: factorize filter creation Tejun Heo
2011-11-23 15:19   ` Steven Rostedt
2011-11-23 15:59     ` Tejun Heo
2011-11-28 20:49   ` Tejun Heo
2011-11-28 22:15     ` Steven Rostedt
2011-12-08 23:32       ` Tejun Heo
2011-12-09  0:15         ` Steven Rostedt
2011-12-09  0:46         ` Steven Rostedt
2011-12-09 18:55           ` Tejun Heo
2011-12-09 19:43   ` [PATCH 2/2 UPDATED] " Tejun Heo
2011-11-23 15:16 ` [PATCH 1/2] trace_events_filter: use rcu_assign_pointer() when setting ftrace_event_call->filter Steven Rostedt
2011-11-23 16:06   ` Tejun Heo
2011-11-23 16:12     ` Tejun Heo
2011-11-23 17:06     ` Steven Rostedt
2011-11-23 17:33       ` Tejun Heo
2011-11-28 16:49         ` Paul E. McKenney
2011-11-23 16:40 ` Eric Dumazet
2011-11-23 16:44   ` Tejun Heo
2011-11-23 16:49 ` [PATCH UPDATED " Tejun Heo
2011-12-05 17:34   ` [tip:perf/urgent] trace_events_filter: Use " tip-bot for Tejun Heo

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).