Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

scripts/gdb: fix lx-mounts command error

(gdb) lx-mounts
mount super_block devname pathname fstype options
Python Exception <class 'gdb.error'>: There is no member named list.
Error occurred in Python: There is no member named list.

We encounter the above issue after commit 2eea9ce4310d ("mounts: keep
list of mounts in an rbtree"). The commit move a mount from list into
rbtree.

So we can instead use rbtree to iterate all mounts information.

Link: https://lkml.kernel.org/r/20240723064902.124154-4-kuan-ying.lee@canonical.com
Fixes: 2eea9ce4310d ("mounts: keep list of mounts in an rbtree")
Signed-off-by: Kuan-Ying Lee <kuan-ying.lee@canonical.com>
Cc: Jan Kiszka <jan.kiszka@siemens.com>
Cc: Kieran Bingham <kbingham@kernel.org>
Cc: <stable@vger.kernel.org>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>

authored by

Kuan-Ying Lee and committed by
Andrew Morton
4b183f61 0c77e103

+2 -2
+2 -2
scripts/gdb/linux/proc.py
··· 18 18 from linux import tasks 19 19 from linux import lists 20 20 from linux import vfs 21 + from linux import rbtree 21 22 from struct import * 22 23 23 24 ··· 173 172 gdb.write("{:^18} {:^15} {:>9} {} {} options\n".format( 174 173 "mount", "super_block", "devname", "pathname", "fstype")) 175 174 176 - for mnt in lists.list_for_each_entry(namespace['list'], 177 - mount_ptr_type, "mnt_list"): 175 + for mnt in rbtree.rb_inorder_for_each_entry(namespace['mounts'], mount_ptr_type, "mnt_node"): 178 176 devname = mnt['mnt_devname'].string() 179 177 devname = devname if devname else "none" 180 178