mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH] scripts/gdb: Fix dentry_name() lookup
@ 2025-06-19 22:51 Florian Fainelli
  2025-06-26 17:01 ` Illia Ostapyshyn
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2025-06-19 22:51 UTC (permalink / raw)
  To: linux-kernel
  Cc: Florian Fainelli, Jan Kiszka, Kieran Bingham, Al Viro,
	Jeff Layton, Jan Kara, Andrew Morton

The "d_iname" member was replaced with "d_shortname.string" in the
commit referenced in the Fixes tag. This prevented the GDB script
"lx-mount" command to properly function:

(gdb) lx-mounts
      mount          super_block     devname pathname fstype options
0xff11000002d21180 0xff11000002d24800 rootfs / rootfs rw 0 0
0xff11000002e18a80 0xff11000003713000 /dev/root / ext4 rw,relatime 0 0
Python Exception <class 'gdb.error'>: There is no member named d_iname.
Error occurred in Python: There is no member named d_iname.

Fixes: 58cf9c383c5c ("dcache: back inline names with a struct-wrapped array of unsigned long")
Signed-off-by: Florian Fainelli <florian.fainelli@broadcom.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 c77b9ce75f6d..b5fbb18ccb77 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_iname'].string()
+    return p + d['d_shortname']['string'].string()
 
 class DentryName(gdb.Function):
     """Return string of the full path of a dentry.
-- 
2.43.0


^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts/gdb: Fix dentry_name() lookup
  2025-06-19 22:51 [PATCH] scripts/gdb: Fix dentry_name() lookup Florian Fainelli
@ 2025-06-26 17:01 ` Illia Ostapyshyn
  2025-06-26 17:19   ` Florian Fainelli
  0 siblings, 1 reply; 4+ messages in thread
From: Illia Ostapyshyn @ 2025-06-26 17:01 UTC (permalink / raw)
  To: florian.fainelli
  Cc: akpm, jack, jan.kiszka, jlayton, kbingham, linux-kernel, viro

Hi Florian,

I have previously submitted (and resent due to inactivity) an equivalent
patch here:

https://lore.kernel.org/all/20250428142117.3455683-1-illia@yshyn.com/
https://lore.kernel.org/all/20250525213709.878287-2-illia@yshyn.com/

However, looks like d_shortname is not suitable for entries with name
longer than D_NAME_INLINE_LEN characters.  Although this matches the
previous behavior of the GDB script (before 58cf9c383c5c68666808), I was
planning to resubmit a v2 that addresses this issue as well.

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts/gdb: Fix dentry_name() lookup
  2025-06-26 17:01 ` Illia Ostapyshyn
@ 2025-06-26 17:19   ` Florian Fainelli
  2025-06-26 22:09     ` Andrew Morton
  0 siblings, 1 reply; 4+ messages in thread
From: Florian Fainelli @ 2025-06-26 17:19 UTC (permalink / raw)
  To: Illia Ostapyshyn
  Cc: akpm, jack, jan.kiszka, jlayton, kbingham, linux-kernel, viro

Hi Illia,

On 6/26/25 10:01, Illia Ostapyshyn wrote:
> Hi Florian,
> 
> I have previously submitted (and resent due to inactivity) an equivalent
> patch here:
> 
> https://lore.kernel.org/all/20250428142117.3455683-1-illia@yshyn.com/
> https://lore.kernel.org/all/20250525213709.878287-2-illia@yshyn.com/

Ah my bad, I had not seen your submission, then it should be taken 
instead of mine, but with the Fixes: tag added so that your patch can 
get back ported to stable trees.

> 
> However, looks like d_shortname is not suitable for entries with name
> longer than D_NAME_INLINE_LEN characters.  Although this matches the
> previous behavior of the GDB script (before 58cf9c383c5c68666808), I was
> planning to resubmit a v2 that addresses this issue as well.

Sure, please do! Andrew can you drop my patch in favor of Illia's when 
it shows up?
-- 
Florian

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [PATCH] scripts/gdb: Fix dentry_name() lookup
  2025-06-26 17:19   ` Florian Fainelli
@ 2025-06-26 22:09     ` Andrew Morton
  0 siblings, 0 replies; 4+ messages in thread
From: Andrew Morton @ 2025-06-26 22:09 UTC (permalink / raw)
  To: Florian Fainelli
  Cc: Illia Ostapyshyn, jack, jan.kiszka, jlayton, kbingham,
	linux-kernel, viro

On Thu, 26 Jun 2025 10:19:25 -0700 Florian Fainelli <florian.fainelli@broadcom.com> wrote:

> Hi Illia,
> 
> On 6/26/25 10:01, Illia Ostapyshyn wrote:
> > Hi Florian,
> > 
> > I have previously submitted (and resent due to inactivity) an equivalent
> > patch here:
> > 
> > https://lore.kernel.org/all/20250428142117.3455683-1-illia@yshyn.com/
> > https://lore.kernel.org/all/20250525213709.878287-2-illia@yshyn.com/
> 
> Ah my bad, I had not seen your submission, then it should be taken 
> instead of mine, but with the Fixes: tag added so that your patch can 
> get back ported to stable trees.
> 
> > 
> > However, looks like d_shortname is not suitable for entries with name
> > longer than D_NAME_INLINE_LEN characters.  Although this matches the
> > previous behavior of the GDB script (before 58cf9c383c5c68666808), I was
> > planning to resubmit a v2 that addresses this issue as well.
> 
> Sure, please do! Andrew can you drop my patch in favor of Illia's when 
> it shows up?

I've moved your "scripts/gdb: Fix dentry_name() lookup" into mm.git's
non-rebasing mm-hotfixes-stable branch in preparation for upstreaming
today or tomorrow.  So I'd prefer not to mess with it now.

Illia, can you please propose your fix against a tree which contains
Florian's patch?

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2025-06-26 22:09 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2025-06-19 22:51 [PATCH] scripts/gdb: Fix dentry_name() lookup Florian Fainelli
2025-06-26 17:01 ` Illia Ostapyshyn
2025-06-26 17:19   ` Florian Fainelli
2025-06-26 22:09     ` Andrew Morton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®