Commit 9e528d89 authored by Alexei Starovoitov's avatar Alexei Starovoitov Committed by David S. Miller

net_sched: convert rsvp to call tcf_exts_destroy from rcu callback

Adjust destroy path of cls_rsvp to call tcf_exts_destroy() after
rcu grace period.
Signed-off-by: default avatarAlexei Starovoitov <ast@plumgrid.com>
Acked-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ed7aa879
...@@ -283,12 +283,22 @@ static int rsvp_init(struct tcf_proto *tp) ...@@ -283,12 +283,22 @@ static int rsvp_init(struct tcf_proto *tp)
return -ENOBUFS; return -ENOBUFS;
} }
static void static void rsvp_delete_filter_rcu(struct rcu_head *head)
rsvp_delete_filter(struct tcf_proto *tp, struct rsvp_filter *f)
{ {
tcf_unbind_filter(tp, &f->res); struct rsvp_filter *f = container_of(head, struct rsvp_filter, rcu);
tcf_exts_destroy(&f->exts); tcf_exts_destroy(&f->exts);
kfree_rcu(f, rcu); kfree(f);
}
static void rsvp_delete_filter(struct tcf_proto *tp, struct rsvp_filter *f)
{
tcf_unbind_filter(tp, &f->res);
/* all classifiers are required to call tcf_exts_destroy() after rcu
* grace period, since converted-to-rcu actions are relying on that
* in cleanup() callback
*/
call_rcu(&f->rcu, rsvp_delete_filter_rcu);
} }
static bool rsvp_destroy(struct tcf_proto *tp, bool force) static bool rsvp_destroy(struct tcf_proto *tp, bool force)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment