All of lore.kernel.org
 help / color / mirror / Atom feed
From: Simon Horman <horms@kernel.org>
To: Kuniyuki Iwashima <kuniyu@amazon.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Eric Dumazet <edumazet@google.com>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Kuniyuki Iwashima <kuni1840@gmail.com>,
	netdev@vger.kernel.org
Subject: Re: [PATCH v1 net] rtnetlink: Use register_pernet_subsys() in rtnl_net_debug_init().
Date: Mon, 31 Mar 2025 16:48:49 +0100	[thread overview]
Message-ID: <20250331154849.GC185681@horms.kernel.org> (raw)
In-Reply-To: <20250328220453.97138-1-kuniyu@amazon.com>

On Fri, Mar 28, 2025 at 03:04:48PM -0700, Kuniyuki Iwashima wrote:
> rtnl_net_debug_init() registers rtnl_net_debug_net_ops by
> register_pernet_device() but calls unregister_pernet_subsys()
> in case register_netdevice_notifier() fails.
> 
> It corrupts pernet_list because first_device is not updated
> in unregister_pernet_device().

Hi Iwashima-san,

Maybe I am confused, but should the above line refer to
unregister_pernet_subsys()?

And perhaps it would be yet clearer to say something like:

It corrupts pernet_list because first_device is not updated
in register_pernet_device() but not unregister_pernet_subsys()?

> 
> Let's fix it by calling register_pernet_subsys() instead.
> 
> The _subsys() one fits better for the use case because it keeps
> the notifier alive until default_device_exit_net(), giving it
> more chance to test NETDEV_UNREGISTER.
> 
> Fixes: 03fa53485659 ("rtnetlink: Add ASSERT_RTNL_NET() placeholder for netdev notifier.")
> Signed-off-by: Kuniyuki Iwashima <kuniyu@amazon.com>

...

  reply	other threads:[~2025-03-31 15:48 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-03-28 22:04 [PATCH v1 net] rtnetlink: Use register_pernet_subsys() in rtnl_net_debug_init() Kuniyuki Iwashima
2025-03-31 15:48 ` Simon Horman [this message]
2025-03-31 18:25   ` Kuniyuki Iwashima

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=20250331154849.GC185681@horms.kernel.org \
    --to=horms@kernel.org \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=kuba@kernel.org \
    --cc=kuni1840@gmail.com \
    --cc=kuniyu@amazon.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.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.