Re: [PATCH] dcache: add extra sanity checks of the dentry in dentry_free()
From: Jori Koolstra
Date: Wed Apr 22 2026 - 10:12:34 EST
> Op 22-04-2026 15:53 CEST schreef Jeff Layton <jlayton@xxxxxxxxxx>:
>
>
> On Wed, 2026-04-22 at 15:16 +0200, Jori Koolstra wrote:
> > On Wed, Apr 22, 2026 at 07:29:48AM -0400, Jeff Layton wrote:
> > >
> > > +#define DENTRY_WARN_ONCE(condition, dentry) \
> > > + WARN_ONCE((condition), "dentry=%p d_flags=0x%x\n", (dentry), (dentry)->d_flags)
> > >
> >
> > I guess this is one of those instances where using %p is acceptable?
> > Maybe Documentation/process/deprecated.rst is worded a bit too harshly.
>
> I'm not opposed to using something different, but I think the hashed
> pointer value is fine here. Mostly I just want some way to tell whether
> different warnings might have been triggered by the same dentry.
Yes, I get that. And there isn't really any other clear marker for struct dentry
AFAIK. Also, this is probably better than using %pd.
Feel free to add:
Reviewed-by: Jori Koolstra <jkoolstra@xxxxxxxxx>
> --
> Jeff Layton <jlayton@xxxxxxxxxx>