int ref;
struct event_trigger_ops *ops;
struct event_command *cmd_ops;
- struct event_filter *filter;
+ struct event_filter __rcu *filter;
char *filter_str;
void *private_data;
struct list_head list;
{
struct event_trigger_data *data;
enum event_trigger_type tt = ETT_NONE;
+ struct event_filter *filter;
if (list_empty(&file->triggers))
return tt;
data->ops->func(data);
continue;
}
- if (data->filter && !filter_match_preds(data->filter, rec))
+ filter = rcu_dereference(data->filter);
+ if (filter && !filter_match_preds(filter, rec))
continue;
if (data->cmd_ops->post_trigger) {
tt |= data->cmd_ops->trigger_type;
if (ret)
goto out;
assign:
- tmp = data->filter;
+ tmp = rcu_access_pointer(data->filter);
rcu_assign_pointer(data->filter, filter);
if (filter_str) {
data->filter_str = kstrdup(filter_str, GFP_KERNEL);
if (!data->filter_str) {
- free_event_filter(data->filter);
+ free_event_filter(rcu_access_pointer(data->filter));
data->filter = NULL;
ret = -ENOMEM;
}