From: Jakub Kicinski <kuba@kernel.org>
To: Haiyang Zhang <haiyangz@linux.microsoft.com>, kuniyu@google.com
Cc: linux-hyperv@vger.kernel.org, netdev@vger.kernel.org,
haiyangz@microsoft.com, kys@microsoft.com, wei.liu@kernel.org,
edumazet@google.com, pabeni@redhat.com, horms@kernel.org,
davem@davemloft.net, sdf@fomichev.me, ahmed.zaki@intel.com,
aleksander.lobakin@intel.com, linux-kernel@vger.kernel.org
Subject: Re: [PATCH net] net: core: Fix the loop in default_device_exit_net()
Date: Fri, 18 Jul 2025 16:37:23 -0700 [thread overview]
Message-ID: <20250718163723.4390bd7d@kernel.org> (raw)
In-Reply-To: <1752870014-28909-1-git-send-email-haiyangz@linux.microsoft.com>
On Fri, 18 Jul 2025 13:20:14 -0700 Haiyang Zhang wrote:
> The loop in default_device_exit_net() won't be able to properly detect the
> head then stop, and will hit NULL pointer, when a driver, like hv_netvsc,
> automatically moves the slave device together with the master device.
>
> To fix this, add a helper function to return the first migratable netdev
> correctly, no matter one or two devices were removed from this net's list
> in the last iteration.
FTR I think that what the driver is trying to do is way too hacky, and
it should be fixed instead. But I defer to Kuniyuki for the final word,
maybe this change is useful for other reasons..
next prev parent reply other threads:[~2025-07-18 23:37 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-07-18 20:20 [PATCH net] net: core: Fix the loop in default_device_exit_net() Haiyang Zhang
2025-07-18 23:37 ` Jakub Kicinski [this message]
2025-07-19 20:47 ` Kuniyuki Iwashima
2025-07-22 16:20 ` [EXTERNAL] " Haiyang Zhang
2025-07-22 6:51 ` Eric Dumazet
2025-07-22 16:15 ` [EXTERNAL] " Haiyang Zhang
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=20250718163723.4390bd7d@kernel.org \
--to=kuba@kernel.org \
--cc=ahmed.zaki@intel.com \
--cc=aleksander.lobakin@intel.com \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=haiyangz@linux.microsoft.com \
--cc=haiyangz@microsoft.com \
--cc=horms@kernel.org \
--cc=kuniyu@google.com \
--cc=kys@microsoft.com \
--cc=linux-hyperv@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@fomichev.me \
--cc=wei.liu@kernel.org \
/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.