All of lore.kernel.org
 help / color / mirror / Atom feed
From: Hangbin Liu <hangbin.liu@linux.dev>
To: Jakub Kicinski <kuba@kernel.org>
Cc: davem@davemloft.net, netdev@vger.kernel.org, edumazet@google.com,
	pabeni@redhat.com, andrew+netdev@lunn.ch, horms@kernel.org,
	daniel@iogearbox.net, razor@blackwall.org,
	bobbyeshleman@meta.com, sdf@fomichev.me
Subject: Re: [PATCH net-next v2 2/3] netdev: avoid skipping objects on race with device disappearance
Date: Tue, 1 Sep 2026 17:15:14 +0800	[thread overview]
Message-ID: <apaXopeQGUR-xku2@fedora> (raw)
In-Reply-To: <20260831164159.1124679-3-kuba@kernel.org>

On Mon, Aug 31, 2026 at 09:41:57AM -0700, Jakub Kicinski wrote:
> If the currently dumped device disappears while we were mid-dump
> we will get the next device without resetting the sub-object ID.
> This is quite unlikely, it was reported by an AI tool not a real
> user. Let's fix it for better dump consistency.
> 
> Reviewed-by: Bobby Eshleman <bobbyeshleman@meta.com>
> Acked-by: Daniel Borkmann <daniel@iogearbox.net>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> ---
>  net/core/netdev-genl.c | 22 +++++++++++++++++-----
>  1 file changed, 17 insertions(+), 5 deletions(-)
> 
> diff --git a/net/core/netdev-genl.c b/net/core/netdev-genl.c
> index 04dcd7fc614e..e427bab4c4d2 100644
> --- a/net/core/netdev-genl.c
> +++ b/net/core/netdev-genl.c
> @@ -312,11 +312,14 @@ int netdev_nl_napi_get_dumpit(struct sk_buff *skb, struct netlink_callback *cb)
>  			err = -ENODEV;
>  		}
>  	} else {
> +		unsigned long start_ifindex = ctx->ifindex;

The NETDEV_A_QUEUE_IFINDEX policy is u32. And all ifindex getting/setting
in 6b6171db7fc8 ("netdev-genl: Add netlink framework functions for queue")
is u32. Why the ifindex is defined to unsigned long?

Thanks
Hangbin

  parent reply	other threads:[~2026-09-01  9:15 UTC|newest]

Thread overview: 12+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 16:41 [PATCH net-next v2 0/3] netdev: address a handful of nit picks Jakub Kicinski
2026-08-31 16:41 ` [PATCH net-next v2 1/3] netdev: correct error code in netdev_nl_queue_fill_lease() Jakub Kicinski
2026-09-01  6:58   ` Nikolay Aleksandrov
2026-08-31 16:41 ` [PATCH net-next v2 2/3] netdev: avoid skipping objects on race with device disappearance Jakub Kicinski
2026-09-01  6:58   ` Nikolay Aleksandrov
2026-09-01  9:15   ` Hangbin Liu [this message]
2026-09-01 15:02     ` Jakub Kicinski
2026-09-02  1:42       ` Hangbin Liu
2026-09-02 19:43   ` [net-next,v2,2/3] " netdev-bot+sashiko
2026-08-31 16:41 ` [PATCH net-next v2 3/3] netdev: don't use dev->flags for IFF_UP Jakub Kicinski
2026-09-01  6:59   ` Nikolay Aleksandrov
2026-09-03  2:20 ` [PATCH net-next v2 0/3] netdev: address a handful of nit picks patchwork-bot+netdevbpf

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=apaXopeQGUR-xku2@fedora \
    --to=hangbin.liu@linux.dev \
    --cc=andrew+netdev@lunn.ch \
    --cc=bobbyeshleman@meta.com \
    --cc=daniel@iogearbox.net \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=kuba@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=razor@blackwall.org \
    --cc=sdf@fomichev.me \
    /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.