1 From 663cb6340c6e84fe29aa6d0fa63d85ea6bd6cd19 Mon Sep 17 00:00:00 2001
2 From: Jackie Liu <liuyun01@kylinos.cn>
3 Date: Thu, 7 Mar 2019 16:30:10 -0800
4 Subject: scripts/gdb: replace flags (MS_xyz -> SB_xyz)
6 From: Jackie Liu <liuyun01@kylinos.cn>
8 commit 663cb6340c6e84fe29aa6d0fa63d85ea6bd6cd19 upstream.
10 Since commit 1751e8a6cb93 ("Rename superblock flags (MS_xyz ->
11 SB_xyz)"), scripts/gdb should be updated to replace MS_xyz with SB_xyz.
13 This change didn't directly affect the running operation of scripts/gdb
14 until commit e262e32d6bde "vfs: Suppress MS_* flag defs within the
15 kernel unless explicitly enabled" removed the definitions used by
18 Update constants.py.in to utilise the new internal flags, matching the
19 implementation at fs/proc_namespace.c::show_sb_opts.
21 Note to stable, e262e32d6bde landed in v5.0-rc1 (which was just
22 released), so we'll want this picked back to 5.0 stable once this patch
23 hits mainline (akpm just picked it up). Without this, debugging a
24 kernel a kernel via GDB+QEMU is broken in the 5.0 release.
26 [kieran.bingham@ideasonboard.com: add fixes tag, reword commit message]
27 Link: http://lkml.kernel.org/r/20190305103014.25847-1-kieran.bingham@ideasonboard.com
28 Fixes: e262e32d6bde "vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled"
29 Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
30 Signed-off-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
31 Tested-by: Nick Desaulniers <ndesaulniers@google.com>
32 Tested-by: Kieran Bingham <kieran.bingham@ideasonboard.com>
33 Cc: Felipe Balbi <felipe.balbi@linux.intel.com>
34 Cc: Dan Robertson <danlrobertson89@gmail.com>
35 Cc: Jan Kiszka <jan.kiszka@siemens.com>
36 Cc: David Howells <dhowells@redhat.com>
37 Cc: <stable@vger.kernel.org>
38 Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
39 Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
40 Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
43 scripts/gdb/linux/constants.py.in | 12 ++++++------
44 scripts/gdb/linux/proc.py | 12 ++++++------
45 2 files changed, 12 insertions(+), 12 deletions(-)
47 --- a/scripts/gdb/linux/constants.py.in
48 +++ b/scripts/gdb/linux/constants.py.in
54 -LX_VALUE(MS_SYNCHRONOUS)
55 -LX_VALUE(MS_MANDLOCK)
58 -LX_VALUE(MS_NODIRATIME)
60 +LX_VALUE(SB_SYNCHRONOUS)
61 +LX_VALUE(SB_MANDLOCK)
64 +LX_VALUE(SB_NODIRATIME)
68 --- a/scripts/gdb/linux/proc.py
69 +++ b/scripts/gdb/linux/proc.py
70 @@ -114,11 +114,11 @@ def info_opts(lst, opt):
74 -FS_INFO = {constants.LX_MS_SYNCHRONOUS: ",sync",
75 - constants.LX_MS_MANDLOCK: ",mand",
76 - constants.LX_MS_DIRSYNC: ",dirsync",
77 - constants.LX_MS_NOATIME: ",noatime",
78 - constants.LX_MS_NODIRATIME: ",nodiratime"}
79 +FS_INFO = {constants.LX_SB_SYNCHRONOUS: ",sync",
80 + constants.LX_SB_MANDLOCK: ",mand",
81 + constants.LX_SB_DIRSYNC: ",dirsync",
82 + constants.LX_SB_NOATIME: ",noatime",
83 + constants.LX_SB_NODIRATIME: ",nodiratime"}
85 MNT_INFO = {constants.LX_MNT_NOSUID: ",nosuid",
86 constants.LX_MNT_NODEV: ",nodev",
87 @@ -184,7 +184,7 @@ values of that process namespace"""
88 fstype = superblock['s_type']['name'].string()
89 s_flags = int(superblock['s_flags'])
90 m_flags = int(vfs['mnt']['mnt_flags'])
91 - rd = "ro" if (s_flags & constants.LX_MS_RDONLY) else "rw"
92 + rd = "ro" if (s_flags & constants.LX_SB_RDONLY) else "rw"
95 "{} {} {} {}{}{} 0 0\n"