linux/tools/testing/selftests/filesystems/overlayfs
Christian Brauner 1ec284f38b
selftests/filesystems/overlayfs: test idmapped overlay mounts
Add a selftest for idmapping the merged overlay mount itself.  It
applies an idmapping to a freshly created (still detached) overlay
mount with mount_setattr(MOUNT_ATTR_IDMAP) and checks that:

  - getattr reports ownership mapped through the mount idmap;
  - a file created through the idmapped mount is stored on the upper
    layer with the corresponding overlay-final id;
  - chown through the idmapped mount round-trips;
  - an nfs_export overlay can be idmapped and decodable file handles
    round-trip through it with correctly mapped ownership.

The layers live on a private tmpfs and are owned by the host id so that
they map to id 0 through the test idmapping, allowing the root caller
to operate on them.

Link: https://patch.msgid.link/20260615-work-idmapped-overlayfs-v1-9-7381632aa402@kernel.org
Reviewed-by: Amir Goldstein <amir73il@gmail.com>
Signed-off-by: Christian Brauner (Amutable) <brauner@kernel.org>
2026-06-29 10:32:32 +02:00
..
.gitignore selftests/filesystems/overlayfs: test idmapped overlay mounts 2026-06-29 10:32:32 +02:00
dev_in_maps.c selftests: complete kselftest include centralization 2025-11-27 14:24:31 -08:00
idmapped_mounts.c selftests/filesystems/overlayfs: test idmapped overlay mounts 2026-06-29 10:32:32 +02:00
log.h
Makefile selftests/filesystems/overlayfs: test idmapped overlay mounts 2026-06-29 10:32:32 +02:00
set_layers_via_fds.c selftests/filesystems/overlayfs: fix set_layers_via_fds link error 2026-06-29 10:32:32 +02:00