]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
selftests/filesystems/overlayfs: test idmapped overlay mounts
authorChristian Brauner <brauner@kernel.org>
Mon, 15 Jun 2026 13:19:58 +0000 (15:19 +0200)
committerChristian Brauner <brauner@kernel.org>
Mon, 29 Jun 2026 08:32:32 +0000 (10:32 +0200)
commit1ec284f38b9f6d60c1e2c935a37bd6484cd2d14d
tree7b953a1dcda201154c4e34020f88e7b14b78187e
parente5804b1024193c91ff2648403beda882cb4f8b6c
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>
tools/testing/selftests/filesystems/overlayfs/.gitignore
tools/testing/selftests/filesystems/overlayfs/Makefile
tools/testing/selftests/filesystems/overlayfs/idmapped_mounts.c [new file with mode: 0644]