[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <b9b2261a-5a35-fdf7-79b5-9d644e3ed097@mojatatu.com>
Date: Fri, 20 Dec 2019 07:11:12 -0500
From: Jamal Hadi Salim <jhs@...atatu.com>
To: Vlad Buslov <vladbu@...lanox.com>
Cc: Davide Caratti <dcaratti@...hat.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"David S. Miller" <davem@...emloft.net>,
Cong Wang <xiyou.wangcong@...il.com>,
Jiri Pirko <jiri@...nulli.us>, Roman Mashak <mrv@...atatu.com>
Subject: Re: [PATCH net 1/2] net/sched: cls_u32: fix refcount leak in the
error path of u32_change()
On 2019-12-19 12:01 p.m., Vlad Buslov wrote:
>
> BTW another approach would be to extend ops with new callback
> delete_empty(), require unlocked implementation to define it and move
> functionality of tcf_proto_check_delete() there. Such approach would
> remove the need for (ab)using ops->walk() for this since internally
> in classifier implementation there is always a way to correctly verify
> that classifier instance is empty. Don't know which approach is better
> in this case.
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
delete_empty() (instead of walk()) if you go past that.
Would that work?
cheers,
jamal
Powered by blists - more mailing lists