btrfs/242: introduce btrfs specific idmapped mounts tests
While core vfs functionality that btrfs implements is completely covered
by the generic test-suite the btrfs specific ioctls are not.
This patch expands the test-suite to cover btrfs specific ioctls that
are have required changes to work on idmapped mounts. We deliberately
don't use the libbtrfsutil library as we need to know exactly what
ioctl's are issued and we need to be in control of all privileges at all
times. This test-suite currently tests:
- BTRFS_IOC_{SNAP,SUBVOL}_CREATE_V2
- subvolume creation on idmapped mounts where the fsids do have a
mapping in the superblock
- snapshot creation on idmapped mounts where the fsids do have a
mapping in the superblock
- subvolume creation on idmapped mounts where the fsids do not have a
mapping in the superblock
- snapshot creation on idmapped mounts where the fsids do not have
a mapping in the superblock
- subvolume creation on idmapped mounts where the caller is
located in a user namespace and the fsids do have a mapping
in the superblock
- snapshot creation on idmapped mounts where the caller is located
in a user namespace and the fsids do have a mapping in the
superblock
- subvolume creation on idmapped mounts where the caller is
located in a user namespace and the fsids do not have a mapping
in the superblock
- snapshot creation on idmapped mounts where the caller is located
in a user namespace and the fsids do not have a mapping in the
superblock
- BTRFS_IOC_SNAP_DESTROY_V2
- subvolume deletion on idmapped mounts where the fsids do have a
mapping in the superblock
- snapshot deletion on idmapped mounts where the fsids do have a
mapping in the superblock
- subvolume deletion on idmapped mounts where the fsids do not have a
mapping in the superblock
- snapshot deletion on idmapped mounts where the fsids do not have
a mapping in the superblock
- subvolume deletion on idmapped mounts where the caller is
located in a user namespace and the fsids do have a mapping
in the superblock
- snapshot deletion on idmapped mounts where the caller is located
in a user namespace and the fsids do have a mapping in the
superblock
- subvolume deletion on idmapped mounts where the caller is
located in a user namespace and the fsids do not have a mapping
in the superblock
- snapshot deletion on idmapped mounts where the caller is located
in a user namespace and the fsids do not have a mapping in the
superblock
- unprivileged subvolume deletion on idmapped mounts where the fsids
do have a mapping in the superblock and the filesystem is mounted
with "user_subvol_rm_allowed"
- unprivileged snapshot deletion on idmapped mounts where the fsids do
have a mapping in the superblock and the filesystem is mounted with
"user_subvol_rm_allowed"
- subvolume deletion on idmapped mounts where the caller is
located in a user namespace and the fsids do have a mapping
in the superblock and the filesystem is mounted with
"user_subvol_rm_allowed"
- snapshot deletion on idmapped mounts where the caller is located
in a user namespace and the fsids do have a mapping in the
superblock and the filesystem is mounted with
"user_subvol_rm_allowed"
- BTRFS_IOC_SUBVOL_SETFLAGS
- subvolume flags on idmapped mounts where the fsids do have a mapping
in the superblock
- snapshot flags on idmapped mounts where the fsids do have a mapping
in the superblock
- subvolume flags on idmapped mounts where the fsids do not have a
mapping in the superblock
- snapshot flags on idmapped mounts where the fsids do not have a
mapping in the superblock
- subvolume flags on idmapped mounts where the caller is located in a
user namespace and the fsids do have a mapping in the superblock
- snapshot flags on idmapped mounts where the caller is located in a
user namespace and the fsids do have a mapping in the superblock
- subvolume flags on idmapped mounts where the caller is located in a
user namespace and the fsids do not have a mapping in the superblock
- snapshot flags on idmapped mounts where the caller is located in a
user namespace and the fsids do not have a mapping in the superblock
- BTRFS_IOC_INO_LOOKUP_USER
- subvolume lookup on idmapped mounts where the fsids do have a mapping
in the superblock
- subvolume lookup on idmapped mounts where the fsids do not have a
mapping in the superblock
- subvolume lookup on idmapped mounts where the caller is located in a
user namespace and the fsids do have a mapping in the superblock
- subvolume lookup on idmapped mounts where the caller is located in a
user namespace and the fsids do not have a mapping in the superblock
Cc: Chris Mason <clm@fb.com>
Cc: Josef Bacik <josef@toxicpanda.com>
Cc: Christoph Hellwig <hch@infradead.org>
Cc: David Sterba <dsterba@suse.com>
Cc: fstests@vger.kernel.org
Cc: linux-btrfs@vger.kernel.org
Signed-off-by: Christian Brauner <christian.brauner@ubuntu.com>
3 files changed