[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <20141003163333.20118.59609.stgit@nitbit.x32>
Date: Fri, 03 Oct 2014 09:33:35 -0700
From: John Fastabend <john.fastabend@...il.com>
To: xiyou.wangcong@...il.com, davem@...emloft.net
Cc: netdev@...r.kernel.org, jhs@...atatu.com, eric.dumazet@...il.com
Subject: [PATCH] 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@...el.com>
---
net/sched/cls_cgroup.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
diff --git a/net/sched/cls_cgroup.c b/net/sched/cls_cgroup.c
index d4fef3a..dead710 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)
struct cls_cgroup_head *head = rtnl_dereference(tp->root);
if (head) {
- tcf_exts_destroy(&head->exts);
- tcf_em_tree_destroy(head->net, &head->ematches);
RCU_INIT_POINTER(tp->root, NULL);
- kfree_rcu(head, rcu);
+ call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
}
}
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists