Skip to contentSkip to conversation

scripts/gdb: fix linux constants

PATCH New Kieran Bingham 2 participants 4 messages Feb 15, 2019 – Feb 18, 2019 1 message not in the archive GDB kernel debugging helper scripts

lore
Share & tools
lore

Kieran Bingham

author Reviewed-by
#1 lore raw
In reply to a message not in the archive

Hi Dan,

Thank you for the patch,

Quoted 7 lines · Dan Robertson

The linux constants MS_RDONLY, MS_SYNCHRONOUS, MS_MANDLOCK, MS_DIRSYNC, MS_NOATIME, and MS_NODIRATIME were previously defined in linux/fs.h. Following e262e32d6bde0f77fb0c95d977482fc872c51996 the constants are now defined in uapi/linux/mount.h. The new location of the defined constants needs to be included in constants.py template in order for the correct constants to be generated.

This commit was pipped to the post by a similar patch [0] from Felipe Balbi

[0]
https://lore.kernel.org/lkml/[email protected]/

Combined together they would form a complete patch, but this one could do with the Fixes: tag such as

Fixes e262e32d6bde "vfs: Suppress MS_* flag defs within the kernel

unless explicitly enabled"

With a Fixes: tag:

Quoted 10 lines
---
 scripts/gdb/linux/constants.py.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/gdb/linux/constants.py.in +0 -0
index 7aad82406422..6c164761d986 100644

scripts/gdb/linux/constants.py.in line 15

Quoted 4 lines
scripts/gdb/linux/constants.py.in +0 -1
@@ -12,9 +12,9 @@
  *
  */
 
-#include <linux/fs.h>

Whereas Felipe's patch does not include this change (which I think it looks like it should)

How should we proceed with these two competing patches? Any preference from anyone?

Content wise, I feel like this one is in the lead - just missing the
Fixes: tag, but Felipe's won the race...

--
Kieran

Quoted 16 lines
scripts/gdb/linux/constants.py.in +2 -1
 #include <linux/mount.h>
 #include <linux/of_fdt.h>
+#include <uapi/linux/mount.h>
 
 /* We need to stringify expanded macros so that they can be parsed */
 
@@ -36,7 +36,7 @@
 
 import gdb
 
-/* linux/fs.h */
+/* uapi/linux/mount.h */
 LX_VALUE(MS_RDONLY)
 LX_VALUE(MS_SYNCHRONOUS)
 LX_VALUE(MS_MANDLOCK)
Signature · 3 lines
Regards
--
Kieran
#2 lore raw

Kieran,

Quoted 1 line

This commit was pipped to the post by a similar patch [0] from Felipe Balbi

No problem! I probably should watch the LKML closer.

Go with the patch from Felipe, but like you men there is definitely no need for the include linux/fs.h now.

Thanks for the tip on the Fixes tag. As a kernel newbie tips like this are appreciated.

Cheers,

Dan

#3 lore raw

cover scripts/gdb: fix linux constants

In reply to Kieran Bingham

Add Fixes tag to commit

Dan Robertson (1):
scripts/gdb: fix linux constants

 scripts/gdb/linux/constants.py.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Signature · 1 line
2.20.1
#4 lore raw

PATCH 1/1 scripts/gdb: fix linux constants

The linux constants MS_RDONLY, MS_SYNCHRONOUS, MS_MANDLOCK, MS_DIRSYNC, MS_NOATIME, and MS_NODIRATIME were previously defined in linux/fs.h. Following e262e32d6bde0f77fb0c95d977482fc872c51996 the constants are now defined in uapi/linux/mount.h. The new location of the defined constants needs to be included in constants.py template in order for the correct constants to be generated.

Fixes e262e32d6bde ("vfs: Suppress MS_* flag defs within the kernel unless explicitly enabled")
---
 scripts/gdb/linux/constants.py.in | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
scripts/gdb/linux/constants.py.in +2 -2
index 7aad82406422..6c164761d986 100644
@@ -12,9 +12,9 @@
  *
  */
 
-#include <linux/fs.h>
 #include <linux/mount.h>
 #include <linux/of_fdt.h>
+#include <uapi/linux/mount.h>
 
 /* We need to stringify expanded macros so that they can be parsed */
 
@@ -36,7 +36,7 @@
 
 import gdb
 
-/* linux/fs.h */
+/* uapi/linux/mount.h */
 LX_VALUE(MS_RDONLY)
 LX_VALUE(MS_SYNCHRONOUS)
 LX_VALUE(MS_MANDLOCK)
Signature · 1 line
2.20.1