Skip to content

filesystems selftests cleanups and fanotify test

Amir Goldstein linux-fsdevel 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest8 patches 12 repliesIn review
  2. v15 patches 21 repliesSuperseded

Changes in v2 from the cover letter

- 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/[email protected]/
[2] https://lore.kernel.org/linux-fsdevel/[email protected]/

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/8selftests/filesystems: move wrapper.h out of overlayfs subdirtools/testing/selftests/filesystems/overlayfs/Makefile tools/testing/selftests/filesystems/overlayfs/dev_in_maps.c tools/testing/selftests/filesystems/overlayfs/set_layers_via_fds.c +3 more+6 -41 reply
2/8selftests/fs/statmount: build with tools include dirtools/include/uapi/linux/mount.h tools/include/uapi/linux/nsfs.h tools/testing/selftests/filesystems/statmount/Makefile +1 more+318 -11 reply
3/8selftests/pidfd: move syscall definitions into wrappers.htools/testing/selftests/filesystems/wrappers.h tools/testing/selftests/pidfd/pidfd_bind_mount.c+42 -741 reply
4/8selftests/mount_settattr: remove duplicate syscall definitionstools/testing/selftests/mount_setattr/mount_setattr_test.c+0 -521 reply
5/8selftests/fs/mount-notify: build with tools include dirtools/include/uapi/linux/fanotify.h tools/testing/selftests/filesystems/mount-notify/Makefile tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c+282 -201 reply
6/8selftests/filesystems: create get_unique_mnt_id() helpertools/testing/selftests/filesystems/mount-notify/Makefile tools/testing/selftests/filesystems/mount-notify/mount-notify_test.c tools/testing/selftests/filesystems/statmount/Makefile +3 more+36 -351 reply
7/8selftests/filesystems: create setup_userns() helpertools/testing/selftests/filesystems/statmount/statmount_test_ns.c tools/testing/selftests/filesystems/utils.c tools/testing/selftests/filesystems/utils.h+68 -571 reply
8/8selftests/fs/mount-notify: add a test variant running inside usernstools/testing/selftests/filesystems/mount-notify/.gitignore tools/testing/selftests/filesystems/mount-notify/Makefile tools/testing/selftests/filesystems/mount-notify/mount-notify_test_ns.c+560 -11 reply

Reviews trailers per patch

All 8 patches have a Reviewed-by or Acked-by.

PatchJohn HubbardChristian Brauner
1/8R-b R-b
2/8R-b R-b
3/8R-b
4/8R-b
5/8R-b R-b
6/8R-b R-b
7/8R-b R-b
8/8R-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 0/8] filesystems selftests cleanups and fanotify test

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/[email protected]/
[2] https://lore.kernel.org/linux-fsdevel/[email protected]/

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%)
Signature · 1 line
2.34.1