[LTP] [PATCH v5] move_mount03: check allow to mount beneath top mount

Petr Vorel pvorel@suse.cz
Fri Feb 21 11:35:19 CET 2025


Hi Wei,

merged with adding 6ac392815628f linux-git tag and formatting changes.
Thank you!

Kind regards,
Petr

+++ include/lapi/fsmount.h
@@ -114,14 +114,14 @@ static inline int mount_setattr(int dirfd, const char *from_pathname, unsigned i
 }
 #endif /* HAVE_MOUNT_SETATTR */
 
-#ifndef MOVE_MOUNT_BENEATH
-#define MOVE_MOUNT_BENEATH 		0x00000200
-#endif /* MOVE_MOUNT_BENEATH */
-
 /*
  * New headers added in kernel after 5.2 release, create them for old userspace.
 */
 
+#ifndef MOVE_MOUNT_BENEATH
+# define MOVE_MOUNT_BENEATH 		0x00000200
+#endif
+
 #ifndef OPEN_TREE_CLONE
 
 /*
diff --git testcases/kernel/syscalls/move_mount/move_mount03.c testcases/kernel/syscalls/move_mount/move_mount03.c
index ad5c8b9ed5..a9429af7a0 100644
--- testcases/kernel/syscalls/move_mount/move_mount03.c
+++ testcases/kernel/syscalls/move_mount/move_mount03.c
@@ -5,8 +5,6 @@
  */
 
 /*\
- * [Description]
- *
  * Test allow to mount beneath top mount feature added in kernel 6.5:
  * 6ac392815628 ("fs: allow to mount beneath top mount")
  *
@@ -14,9 +12,10 @@
  * https://github.com/brauner/move-mount-beneath
  *
  * See also:
- * https://lore.kernel.org/all/20230202-fs-move-mount-replace-v4-0-98f3d80d7eaa@kernel.org/
- * https://lwn.net/Articles/930591/
- * https://github.com/brauner/move-mount-beneath
+ *
+ * - https://lore.kernel.org/all/20230202-fs-move-mount-replace-v4-0-98f3d80d7eaa@kernel.org/
+ * - https://lwn.net/Articles/930591/
+ * - https://github.com/brauner/move-mount-beneath
  */
 
 /*
@@ -68,7 +67,6 @@
  *           --/mnt    /DIRA /DIRB
  *         Check content of /DIRB, you can see file A exist since
  *         current /DIRB mount source is already become /DIRA
- *
  */
 
 #include <stdio.h>
@@ -142,4 +140,8 @@ static struct tst_test test = {
 	.needs_tmpdir = 1,
 	.setup = setup,
 	.cleanup = cleanup,
+	.tags = (const struct tst_tag[]) {
+		{"linux-git", "6ac392815628f"},
+		{}
+	},
 };


More information about the ltp mailing list