lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <f2110674637d775d3d453da8d7171f9f6461ff92.camel@kernel.org>
Date: Mon, 09 Jun 2025 14:10:52 -0400
From: Jeff Layton <jlayton@...nel.org>
To: Jani Nikula <jani.nikula@...ux.intel.com>, Andrew Morton	
 <akpm@...ux-foundation.org>, "David S. Miller" <davem@...emloft.net>, Eric
 Dumazet <edumazet@...gle.com>, Jakub Kicinski <kuba@...nel.org>, Paolo
 Abeni <pabeni@...hat.com>,  Simon Horman <horms@...nel.org>, Maarten
 Lankhorst <maarten.lankhorst@...ux.intel.com>, Maxime Ripard	
 <mripard@...nel.org>, Thomas Zimmermann <tzimmermann@...e.de>, David Airlie
	 <airlied@...il.com>, Simona Vetter <simona@...ll.ch>, Joonas Lahtinen	
 <joonas.lahtinen@...ux.intel.com>, Rodrigo Vivi <rodrigo.vivi@...el.com>, 
 Tvrtko Ursulin <tursulin@...ulin.net>
Cc: Kuniyuki Iwashima <kuniyu@...zon.com>, Qasim Ijaz <qasdev00@...il.com>, 
 Nathan Chancellor	 <nathan@...nel.org>, Andrew Lunn <andrew@...n.ch>,
 linux-kernel@...r.kernel.org, 	netdev@...r.kernel.org,
 dri-devel@...ts.freedesktop.org, 	intel-gfx@...ts.freedesktop.org
Subject: Re: [PATCH v12 03/10] ref_tracker: add a top level debugfs
 directory for ref_tracker

On Wed, 2025-06-04 at 12:12 +0300, Jani Nikula wrote:
> On Thu, 29 May 2025, Jeff Layton <jlayton@...nel.org> wrote:
> > Add a new "ref_tracker" directory in debugfs. Each individual refcount
> > tracker can register files under there to display info about
> > currently-held references.
> > 
> > Reviewed-by: Andrew Lunn <andrew@...n.ch>
> > Signed-off-by: Jeff Layton <jlayton@...nel.org>
> > ---
> >  lib/ref_tracker.c | 13 +++++++++++++
> >  1 file changed, 13 insertions(+)
> > 
> > diff --git a/lib/ref_tracker.c b/lib/ref_tracker.c
> > index de71439e12a3bab6456910986fa611dfbdd97980..d374e5273e1497cac0d70c02c282baa2c3ab63fe 100644
> > --- a/lib/ref_tracker.c
> > +++ b/lib/ref_tracker.c
> > @@ -273,3 +273,16 @@ int ref_tracker_free(struct ref_tracker_dir *dir,
> >  	return 0;
> >  }
> >  EXPORT_SYMBOL_GPL(ref_tracker_free);
> > +
> > +#ifdef CONFIG_DEBUG_FS
> > +#include <linux/debugfs.h>
> > +
> > +static struct dentry *ref_tracker_debug_dir = (struct dentry *)-ENOENT;
> 
> Nitpick, please prefer ERR_PTR(-ENOENT) over casting inline.
> 
> 
Sorry I didn't respond to this earlier. I'd prefer that too, but when I
try that, I get:

lib/ref_tracker.c:327:47: error: initializer element is not constant
  327 | static struct dentry *ref_tracker_debug_dir = ERR_PTR(-ENOENT);
      |                                               ^~~~~~~


> 
> > +
> > +static int __init ref_tracker_debugfs_init(void)
> > +{
> > +	ref_tracker_debug_dir = debugfs_create_dir("ref_tracker", NULL);
> > +	return 0;
> > +}
> > +late_initcall(ref_tracker_debugfs_init);
> > +#endif /* CONFIG_DEBUG_FS */

-- 
Jeff Layton <jlayton@...nel.org>

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ