OSDN Git Service

net_sched: change tcf_del_walker() to take idrinfo->lock
authorVlad Buslov <vladbu@mellanox.com>
Wed, 19 Sep 2018 23:37:29 +0000 (16:37 -0700)
committerDavid S. Miller <davem@davemloft.net>
Fri, 21 Sep 2018 15:55:05 +0000 (08:55 -0700)
commitec3ed293e76656c1fb5388249e1e61c7d274abfc
tree604673128c39e122b387ecee8db0ad222eb4152d
parent947e326c45dff8010a03db54a81c2068e6c28941
net_sched: change tcf_del_walker() to take idrinfo->lock

Action API was changed to work with actions and action_idr in concurrency
safe manner, however tcf_del_walker() still uses actions without taking a
reference or idrinfo->lock first, and deletes them directly, disregarding
possible concurrent delete.

Change tcf_del_walker() to take idrinfo->lock while iterating over actions
and use new tcf_idr_release_unsafe() to release them while holding the
lock.

And the blocking function fl_hw_destroy_tmplt() could be called when we
put a filter chain, so defer it to a work queue.

Signed-off-by: Vlad Buslov <vladbu@mellanox.com>
[xiyou.wangcong@gmail.com: heavily modify the code and changelog]
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/sched/act_api.c
net/sched/cls_flower.c