Skip to content

Commit e5ac318

Browse files
kylee0215akpm00
authored andcommitted
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 2eea9ce ("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/[email protected] Fixes: 2eea9ce ("mounts: keep list of mounts in an rbtree") Signed-off-by: Kuan-Ying Lee <[email protected]> Cc: Jan Kiszka <[email protected]> Cc: Kieran Bingham <[email protected]> Cc: <[email protected]> Signed-off-by: Andrew Morton <[email protected]>
1 parent 2cc3582 commit e5ac318

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

scripts/gdb/linux/proc.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@
1818
from linux import tasks
1919
from linux import lists
2020
from linux import vfs
21+
from linux import rbtree
2122
from struct import *
2223

2324

@@ -172,8 +173,7 @@ def invoke(self, arg, from_tty):
172173
gdb.write("{:^18} {:^15} {:>9} {} {} options\n".format(
173174
"mount", "super_block", "devname", "pathname", "fstype"))
174175

175-
for mnt in lists.list_for_each_entry(namespace['list'],
176-
mount_ptr_type, "mnt_list"):
176+
for mnt in rbtree.rb_inorder_for_each_entry(namespace['mounts'], mount_ptr_type, "mnt_node"):
177177
devname = mnt['mnt_devname'].string()
178178
devname = devname if devname else "none"
179179

0 commit comments

Comments
 (0)