All of lore.kernel.org
 help / color / mirror / Atom feed
From: Vlad Buslov <vladbu@mellanox.com>
To: Jamal Hadi Salim <jhs@mojatatu.com>
Cc: Vlad Buslov <vladbu@mellanox.com>,
	Davide Caratti <dcaratti@redhat.com>,
	"netdev@vger.kernel.org" <netdev@vger.kernel.org>,
	"David S. Miller" <davem@davemloft.net>,
	Cong Wang <xiyou.wangcong@gmail.com>,
	Jiri Pirko <jiri@resnulli.us>, Roman Mashak <mrv@mojatatu.com>
Subject: Re: [PATCH net 1/2] net/sched: cls_u32: fix refcount leak in the error path of u32_change()
Date: Fri, 20 Dec 2019 14:04:47 +0000	[thread overview]
Message-ID: <vbfa77n2iv8.fsf@mellanox.com> (raw)
In-Reply-To: <cc0a3849-48c0-384d-6dd5-29a6763695f2@mojatatu.com>


On Fri 20 Dec 2019 at 15:29, Jamal Hadi Salim <jhs@mojatatu.com> 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

  reply	other threads:[~2019-12-20 14:04 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2019-12-17 23:00 [PATCH net 0/2] net/sched: cls_u32: fix refcount leak Davide Caratti
2019-12-17 23:00 ` [PATCH net 1/2] net/sched: cls_u32: fix refcount leak in the error path of u32_change() Davide Caratti
2019-12-18 14:23   ` Jamal Hadi Salim
2019-12-19 13:32     ` Jamal Hadi Salim
2019-12-19 16:15       ` Vlad Buslov
2019-12-19 16:33         ` Jamal Hadi Salim
2019-12-19 16:51           ` Vlad Buslov
2019-12-19 17:01             ` Vlad Buslov
2019-12-20 12:11               ` Jamal Hadi Salim
2019-12-20 12:25                 ` Jamal Hadi Salim
2019-12-20 13:29                   ` Jamal Hadi Salim
2019-12-20 14:04                     ` Vlad Buslov [this message]
2019-12-20 14:57                       ` Jamal Hadi Salim
2019-12-20 15:20                         ` Davide Caratti
2019-12-20 15:23                           ` Jamal Hadi Salim
2019-12-20 13:21               ` Davide Caratti
2019-12-20 13:54                 ` Jamal Hadi Salim
2019-12-17 23:00 ` [PATCH net 2/2] tc-testing: initial tdc selftests for cls_u32 Davide Caratti
2019-12-20  1:53 ` [PATCH net 0/2] net/sched: cls_u32: fix refcount leak David Miller
2019-12-20 12:14   ` Jamal Hadi Salim

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=vbfa77n2iv8.fsf@mellanox.com \
    --to=vladbu@mellanox.com \
    --cc=davem@davemloft.net \
    --cc=dcaratti@redhat.com \
    --cc=jhs@mojatatu.com \
    --cc=jiri@resnulli.us \
    --cc=mrv@mojatatu.com \
    --cc=netdev@vger.kernel.org \
    --cc=xiyou.wangcong@gmail.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.