lkml.org 
[lkml]   [2011]   [Nov]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH 1/2] trace_events_filter: use rcu_assign_pointer() when setting ftrace_event_call->filter
From
Date
Le mardi 22 novembre 2011 à 17:46 -0800, Tejun Heo a écrit :
> 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);

Its a minor point, but setting a pointer to NULL certainly doesnt need a
smp_wmb() barrier, so you can use RCU_INIT_POINTER(call->filter, NULL);



--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2011-11-23 17:43    [W:0.102 / U:0.464 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site