Subject: Re: [PATCH net 1/2] net/sched: cls_u32: fix refcount leak in the error path of u32_change()

From: Vlad Buslov <[email-masked]>
Date: Fri, 20 Dec 2019 14:04:47 +0000

On Fri 20 Dec 2019 at 15:29, Jamal Hadi Salim <[email-masked]> wrote:
> On 2019-12-20 7:25 a.m., Jamal Hadi Salim wrote:
>> On 2019-12-20 7:11 a.m., Jamal Hadi Salim wrote:
>>
>>> I see both as complementing each other. delete_empty()
>>> could serves like guidance almost for someone who wants to implement
>>> parallelization (and stops abuse of walk()) and
>>> TCF_PROTO_OPS_DOIT_UNLOCKED is more of a shortcut. IOW, you
>>> could at the top of tcf_proto_check_delete() return true
>>> if TCF_PROTO_OPS_DOIT_UNLOCKED is set while still invoking
>>
>>
>> Something like attached...
>
> Vlad,
> I tested this and it seems to fix the issue. But there may be
> other consequences...
>
> cheers,
> jamal

Hi Jamal,

Yes, I think the patch would work. However, we don't really need the
flags check, if we are going to implement the new ops->delete_empty()
callback because it can work like this:

if (!tp->ops->delete_empty) {
   tp->deleting = true;
   return tp->deleting;
} else {
  return tp->ops->delete_empty(tp);
}

WDYT?

Regards,
Vlad