[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20170521191941.GA4278@nanopsycho>
Date: Sun, 21 May 2017 21:19:41 +0200
From: Jiri Pirko <jiri@...nulli.us>
To: Cong Wang <xiyou.wangcong@...il.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
David Miller <davem@...emloft.net>,
Jamal Hadi Salim <jhs@...atatu.com>,
Eric Dumazet <edumazet@...gle.com>,
Daniel Borkmann <daniel@...earbox.net>,
Simon Horman <simon.horman@...ronome.com>, mlxsw@...lanox.com,
Colin King <colin.king@...onical.com>
Subject: Re: [patch net-next 2/2] net/sched: fix filter flushing
Sun, May 21, 2017 at 08:27:21PM CEST, xiyou.wangcong@...il.com wrote:
>On Sat, May 20, 2017 at 10:54 PM, Jiri Pirko <jiri@...nulli.us> wrote:
>> Sun, May 21, 2017 at 02:16:45AM CEST, xiyou.wangcong@...il.com wrote:
>>>On Sat, May 20, 2017 at 6:01 AM, Jiri Pirko <jiri@...nulli.us> wrote:
>>>> +static void tcf_chain_destroy(struct tcf_chain *chain)
>>>> +{
>>>> + list_del(&chain->list);
>>>> + tcf_chain_flush(chain);
>>>> kfree(chain);
>>>> }
>>>>
>>>> @@ -510,7 +517,7 @@ static int tc_ctl_tfilter(struct sk_buff *skb, struct nlmsghdr *n,
>>>>
>>>> if (n->nlmsg_type == RTM_DELTFILTER && prio == 0) {
>>>> tfilter_notify_chain(net, skb, n, chain, RTM_DELTFILTER);
>>>> - tcf_chain_destroy(chain);
>>>> + tcf_chain_flush(chain);
>>>
>>>
>>>I wonder if we should return EBUSY and do nothing in case of busy?
>>>The chain is no longer visual to new actions after your list_del(), but
>>>the old one could still use and see it.
>>
>> No. User request to flush the chain, that is what happens in the past
>> and that is what should happen now.
>> If there is still a reference, the chain_put will keep the empty chain.
>
>But if you dump the actions, this chain is still shown "goto chain"?
Yes, it will be shown there.
>You can't claim you really delete it as long as actions can still
>see it and dump it.
No, user just wants to delete all the filters. That is done. User does
not care if the actual chain structure is there or not.
Powered by blists - more mailing lists