mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@amazon.com>
To: <jlayton@kernel.org>
Cc: <akpm@linux-foundation.org>, <andrew@lunn.ch>,
	<davem@davemloft.net>, <edumazet@google.com>, <horms@kernel.org>,
	<kuba@kernel.org>, <linux-kernel@vger.kernel.org>,
	<nathan@kernel.org>, <netdev@vger.kernel.org>,
	<pabeni@redhat.com>, <qasdev00@gmail.com>
Subject: Re: [PATCH 4/4] net: register debugfs file for net_device refcnt tracker
Date: Mon, 14 Apr 2025 15:27:36 -0700	[thread overview]
Message-ID: <20250414222926.72911-1-kuniyu@amazon.com> (raw)
In-Reply-To: <20250414-reftrack-dbgfs-v1-4-f03585832203@kernel.org>

From: Jeff Layton <jlayton@kernel.org>
Date: Mon, 14 Apr 2025 10:45:49 -0400
> As a nearly-final step in register_netdevice(), finalize the name in the
> refcount tracker, and register a debugfs file for it.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  net/core/dev.c | 2 ++
>  1 file changed, 2 insertions(+)
> 
> diff --git a/net/core/dev.c b/net/core/dev.c
> index 2f7f5fd9ffec7c0fc219eb6ba57d57a55134186e..db9cac702bb2230ca2bbc2c04ac0a77482c65fc3 100644
> --- a/net/core/dev.c
> +++ b/net/core/dev.c
> @@ -10994,6 +10994,8 @@ int register_netdevice(struct net_device *dev)
>  	    dev->rtnl_link_state == RTNL_LINK_INITIALIZED)
>  		rtmsg_ifinfo(RTM_NEWLINK, dev, ~0U, GFP_KERNEL, 0, NULL);
>  
> +	/* Register debugfs file for the refcount tracker */
> +	ref_tracker_dir_debugfs(&dev->refcnt_tracker, dev->name);

dev->name is not unique across network namespaces, so we should specify
a netns-specific parent dir here.

For example, syzkaller creates a bunch of devices with the same name in
different network namespaces.

Then, we also need to move the file when dev is moved to another netns
in __dev_change_net_namespace().

  reply	other threads:[~2025-04-14 22:29 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-04-14 14:45 [PATCH 0/4] ref_tracker: register debugfs files for each ref_tracker_dir Jeff Layton
2025-04-14 14:45 ` [PATCH 1/4] ref_tracker: add a top level debugfs directory for ref_tracker Jeff Layton
2025-04-14 22:35   ` Andrew Lunn
2025-04-14 14:45 ` [PATCH 2/4] ref_tracker: add ability to register a file in debugfs for a ref_tracker_dir Jeff Layton
2025-04-14 22:53   ` Andrew Lunn
2025-04-14 23:08   ` Andrew Lunn
2025-04-15 10:23     ` Jeff Layton
2025-04-15 12:54       ` Jeff Layton
2025-04-15 14:50         ` Jeff Layton
2025-04-14 14:45 ` [PATCH 3/4] net: add ref_tracker_dir_debugfs() calls for netns refcount tracking Jeff Layton
2025-04-14 14:45 ` [PATCH 4/4] net: register debugfs file for net_device refcnt tracker Jeff Layton
2025-04-14 22:27   ` Kuniyuki Iwashima [this message]
2025-04-14 23:16     ` Andrew Lunn
2025-04-15  1:56       ` 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=20250414222926.72911-1-kuniyu@amazon.com \
    --to=kuniyu@amazon.com \
    --cc=akpm@linux-foundation.org \
    --cc=andrew@lunn.ch \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=horms@kernel.org \
    --cc=jlayton@kernel.org \
    --cc=kuba@kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=nathan@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=qasdev00@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®