[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAM_iQpVgdyRDYwGUuRUDYxhkRTZWZWG9H51e0-ccw0Vawex-PA@mail.gmail.com>
Date: Thu, 9 Nov 2017 15:52:41 -0800
From: Cong Wang <xiyou.wangcong@...il.com>
To: Roman Mashak <mrv@...atatu.com>
Cc: Linux Kernel Network Developers <netdev@...r.kernel.org>,
Lucas Bates <lucasb@...atatu.com>,
Jamal Hadi Salim <jhs@...atatu.com>,
Jiri Pirko <jiri@...nulli.us>
Subject: Re: [Patch net 05/13] cls_cgroup: use tcf_exts_get_net() before call_rcu()
On Thu, Nov 9, 2017 at 2:31 PM, Roman Mashak <mrv@...atatu.com> wrote:
> Cong Wang <xiyou.wangcong@...il.com> writes:
>> @@ -124,8 +130,10 @@ static int cls_cgroup_change(struct net *net, struct sk_buff *in_skb,
>> goto errout;
>>
>> rcu_assign_pointer(tp->root, new);
>> - if (head)
>> + if (head) {
>> + tcf_exts_get_net(&head->exts);
>> call_rcu(&head->rcu, cls_cgroup_destroy_rcu);
>
> In this case why do you not need to care about success/failure of
> tcf_exts_get_net() ?
The answer is right in the changelog you omitted... Quoted below:
"Note, on ->destroy() path we have to respect the return value
of tcf_exts_get_net(), on other paths it should always return
true, so we don't need to care."
Powered by blists - more mailing lists