[PATCH] scripts: gdb: vfs: Support external dentry names

Illia Ostapyshyn posted 1 patch 3 months, 1 week ago
scripts/gdb/linux/vfs.py | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
[PATCH] scripts: gdb: vfs: Support external dentry names
Posted by Illia Ostapyshyn 3 months, 1 week ago
d_shortname of struct dentry only reserves D_NAME_INLINE_LEN characters
and contains garbage for longer names.  Use d_name instead, which always
references the valid name.

Link: https://lore.kernel.org/all/20250525213709.878287-2-illia@yshyn.com/
Fixes: 79300ac805b672a84b64 ("scripts/gdb: fix dentry_name() lookup")
Signed-off-by: Illia Ostapyshyn <illia@yshyn.com>
---
 scripts/gdb/linux/vfs.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/scripts/gdb/linux/vfs.py b/scripts/gdb/linux/vfs.py
index b5fbb18ccb77..9e921b645a68 100644
--- a/scripts/gdb/linux/vfs.py
+++ b/scripts/gdb/linux/vfs.py
@@ -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_shortname']['string'].string()
+    return p + d['d_name']['name'].string()
 
 class DentryName(gdb.Function):
     """Return string of the full path of a dentry.

base-commit: dfba48a70cb68888efb494c9642502efe73614ed
-- 
2.49.0
Re: [PATCH] scripts: gdb: vfs: Support external dentry names
Posted by Florian Fainelli 3 months, 1 week ago
On 6/28/25 17:38, Illia Ostapyshyn wrote:
> d_shortname of struct dentry only reserves D_NAME_INLINE_LEN characters
> and contains garbage for longer names.  Use d_name instead, which always
> references the valid name.
> 
> Link: https://lore.kernel.org/all/20250525213709.878287-2-illia@yshyn.com/
> Fixes: 79300ac805b672a84b64 ("scripts/gdb: fix dentry_name() lookup")
> Signed-off-by: Illia Ostapyshyn <illia@yshyn.com>

Tested-by: Florian Fainelli <florian.fainelli@broadcom.com>
Reviewed-by: Florian Fainelli <florian.fainelli@broadcom.com>

Thanks Illia!
-- 
Florian