From: Bastien Curutchet <bastien.curutchet@bootlin.com>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: alexis.lothore@bootlin.com, davem@davemloft.net,
edumazet@google.com, horms@kernel.org, kuba@kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org,
pabeni@redhat.com, razor@blackwall.org, stable@vger.kernel.org,
thomas.petazzoni@bootlin.com
Subject: Re: [PATCH net 1/2] rtnetlink: Fix rtnl_net_cmp_locks() when DEBUG is off
Date: Wed, 12 Feb 2025 10:07:37 +0100 [thread overview]
Message-ID: <edb5f1ba-52b8-4c18-be31-a24491c79d66@bootlin.com> (raw)
In-Reply-To: <20250212084519.38648-1-kuniyu@amazon.com>
On 2/12/25 9:45 AM, Kuniyuki Iwashima wrote:
> From: "Bastien Curutchet (eBPF Foundation)" <bastien.curutchet@bootlin.com>
> Date: Wed, 12 Feb 2025 09:23:47 +0100
>> rtnl_net_cmp_locks() always returns -1 if CONFIG_DEBUG_NET_SMALL_RTNL is
>> disabled. However, if CONFIG_DEBUG_NET_SMALL_RTNL is enabled, it returns 0
>> when both inputs are equal. It is then used by rtnl_nets_add() to call
>> put_net() if the net to be added is already present in the struct
>> rtnl_nets. As a result, when rtnl_nets_add() is called on an already
>> present net, put_net() is called only if DEBUG is on.
>
> If CONFIG_DEBUG_NET_SMALL_RTNL is disabled, every duplicate net is
> added to rtnl_nets, so put_net() is expected to be called for each
> in rtnl_nets_destroy().
I see, sorry for the irrelevant series then ...
Best regards,
Bastien
next prev parent reply other threads:[~2025-02-12 9:07 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-12 8:23 [PATCH net 0/2] rtnetlink: Fix small memory leaks Bastien Curutchet (eBPF Foundation)
2025-02-12 8:23 ` [PATCH net 1/2] rtnetlink: Fix rtnl_net_cmp_locks() when DEBUG is off Bastien Curutchet (eBPF Foundation)
2025-02-12 8:45 ` Kuniyuki Iwashima
2025-02-12 9:07 ` Bastien Curutchet [this message]
2025-02-12 8:23 ` [PATCH net 2/2] rtnetlink: Release nets when leaving rtnl_setlink() Bastien Curutchet (eBPF Foundation)
2025-02-12 8:31 ` Kuniyuki Iwashima
2025-02-12 9:05 ` Bastien Curutchet
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=edb5f1ba-52b8-4c18-be31-a24491c79d66@bootlin.com \
--to=bastien.curutchet@bootlin.com \
--cc=alexis.lothore@bootlin.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@amazon.com \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=razor@blackwall.org \
--cc=stable@vger.kernel.org \
--cc=thomas.petazzoni@bootlin.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.