Skip to contentSkip to conversation

dcache: add extra sanity checks of the dentry in dentry_free()

PATCH Jori Koolstra 2 participants 3 messages Apr 22 VFS

lore
Share & tools
lore
#0 lore raw

Review

Quoted 4 lines · Jeff Layton
(quoted diff) +2 -0
+#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.

#1 lore raw
Quoted 8 lines · Jori Koolstra

Review

Quoted 4 lines · Jeff Layton
(quoted diff) +2 -0
+#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.

Signature · 1 line
Jeff Layton <[email protected]>
author Reviewed-by
#2 lore raw
Quoted 14 lines

Op 22-04-2026 15:53 CEST schreef Jeff Layton <[email protected]>:

Quoted 8 lines · Jori Koolstra

Review

Quoted 4 lines · Jeff Layton
(quoted diff) +2 -0
+#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.

Quoted 3 lines

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:

Quoted 2 lines
Signature · 1 line
Jeff Layton <[email protected]>