aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorJohn Fastabend <john.fastabend@gmail.com>2014-10-06 00:28:20 -0400
committerDavid S. Miller <davem@davemloft.net>2014-10-06 18:02:32 -0400
commit13990f8156862fe945a1a226850a6550c8988a33 (patch)
tree9246262a5c0728e0e0f40c5208697cd2dda38126 /net/sched
parent82a470f1119eb7d2e4941b915bf9cd6fd8d54494 (diff)
net: sched: cls_cgroup tear down exts and ematch from rcu callback
It is not RCU safe to destroy the action chain while there is a possibility of readers accessing it. Move this code into the rcu callback using the same rcu callback used in the code patch to make a change to head. Signed-off-by: John Fastabend <john.r.fastabend@intel.com> Acked-by: Cong Wang <cwang@twopensource.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/cls_cgroup.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index 2f77a89655dc..d61a801222c1 100644
--- a/net/sched/cls_cgroup.c
+++ b/net/sched/cls_cgroup.c
@@ -156,10 +156,8 @@ static void cls_cgroup_destroy(struct tcf_proto *tp)
156 struct cls_cgroup_head *head = rtnl_dereference(tp->root); 156 struct cls_cgroup_head *head = rtnl_dereference(tp->root);
157 157
158 if (head) { 158 if (head) {
159 tcf_exts_destroy(&head->exts);
160 tcf_em_tree_destroy(&head->ematches);
161 RCU_INIT_POINTER(tp->root, NULL); 159 RCU_INIT_POINTER(tp->root, NULL);
162 kfree_rcu(head, rcu); 160 call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
163 } 161 }
164} 162}
165 163