Christian, This adds a test for fanotify mount ns notifications inside userns [1]. While working on the test I ended up making lots of cleanups to reduce build dependency on make headers_install. These patches got rid of the dependency for my kvm setup for the affected filesystems tests. Building with TOOLS_INCLUDES dir was recommended by John Hubbard [2]. NOTE #1: these patches are based on a merge of vfs-6.16.mount (changes wrappers.h) into v6.15-rc5 (changes mount-notify_test.c), so if this cleanup is acceptable, we should probably setup a selftests branch for 6.16, so that it can be used to test the fanotify patches. NOTE #2: some of the defines in wrappers.h are left for overlayfs and mount_setattr tests, which were not converted to use TOOLS_INCLUDES. I did not want to mess with those tests. Thanks, Amir. Changes since v1: - Add test for fanotify mntns watch in userns - Fix some braino in statmount_test_ns re-factoring - Add cleanups to pidfd and mount_setattr tests - Add syscall number defs for more archs - Mention some more changes in commit messages - Use ksft_print_msg() in helpers - RVB from John Hubbard [1] https://lore.kernel.org/linux-fsdevel/20250419100657.2654744-1-amir73il@xxxxxxxxx/ [2] https://lore.kernel.org/linux-fsdevel/6dd57f0e-34b4-4456-854b-a8abdba9163b@xxxxxxxxxx/ Amir Goldstein (8): selftests/filesystems: move wrapper.h out of overlayfs subdir selftests/fs/statmount: build with tools include dir selftests/pidfd: move syscall definitions into wrappers.h selftests/mount_settattr: remove duplicate syscall definitions selftests/fs/mount-notify: build with tools include dir selftests/filesystems: create get_unique_mnt_id() helper selftests/filesystems: create setup_userns() helper selftests/fs/mount-notify: add a test variant running inside userns tools/include/uapi/linux/fanotify.h | 274 +++++++++ tools/include/uapi/linux/mount.h | 235 ++++++++ tools/include/uapi/linux/nsfs.h | 45 ++ .../filesystems/mount-notify/.gitignore | 1 + .../filesystems/mount-notify/Makefile | 9 +- .../mount-notify/mount-notify_test.c | 38 +- .../mount-notify/mount-notify_test_ns.c | 557 ++++++++++++++++++ .../selftests/filesystems/overlayfs/Makefile | 2 +- .../filesystems/overlayfs/dev_in_maps.c | 2 +- .../overlayfs/set_layers_via_fds.c | 2 +- .../selftests/filesystems/statmount/Makefile | 6 +- .../filesystems/statmount/statmount.h | 36 ++ .../filesystems/statmount/statmount_test_ns.c | 86 +-- tools/testing/selftests/filesystems/utils.c | 88 +++ tools/testing/selftests/filesystems/utils.h | 3 + .../filesystems/{overlayfs => }/wrappers.h | 42 +- .../testing/selftests/mount_setattr/Makefile | 2 + .../mount_setattr/mount_setattr_test.c | 54 +- .../selftests/pidfd/pidfd_bind_mount.c | 74 +-- 19 files changed, 1312 insertions(+), 244 deletions(-) create mode 100644 tools/include/uapi/linux/fanotify.h create mode 100644 tools/include/uapi/linux/mount.h create mode 100644 tools/include/uapi/linux/nsfs.h create mode 100644 tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c rename tools/testing/selftests/filesystems/{overlayfs => }/wrappers.h (62%) -- 2.34.1