Skip to contentSkip to conversation

scripts/gdb: Use d_shortname instead of d_iname

PATCH RESEND In review Illia Ostapyshyn 2 participants 3 messages May 25, 2025 GDB kernel debugging helper scripts

lore
Share & tools
lore
#0 lore raw

PATCH RESEND 1/1 scripts/gdb: Use d_shortname instead of d_iname

Commit 58cf9c383c5c68666808 ("dcache: back inline names with a struct-wrapped array of unsigned long") introduced a d_shortname union in place of d_iname. However, the gdb scripts for vfs still reference the old field. Update the scripts to reference the correct field and union member.

---
 scripts/gdb/linux/vfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scripts/gdb/linux/vfs.py +1 -1
index c77b9ce75f6d..b5fbb18ccb77 100644
@@ -22,7 +22,7 @@ def dentry_name(d):
     if parent == d or parent == 0:
         return ""
     p = dentry_name(d['d_parent']) + "/"
-    return p + d['d_iname'].string()
+    return p + d['d_shortname']['string'].string()
 
 class DentryName(gdb.Function):
     """Return string of the full path of a dentry.
Signature · 1 line
2.49.0
#1 lore raw
Quoted 5 lines · Illia Ostapyshyn

Commit 58cf9c383c5c68666808 ("dcache: back inline names with a struct-wrapped array of unsigned long") introduced a d_shortname union in place of d_iname. However, the gdb scripts for vfs still reference the old field. Update the scripts to reference the correct field and union member.

You do realize that for dentries with names longer than 40 characters that field contains garbage, right?

#2 lore raw
Quoted 2 lines · Al Viro

You do realize that for dentries with names longer than 40 characters that field contains garbage, right?

Is d_name.name a better choice here? It seems to always reference the full valid name.