linux/tools/testing
zhouyuhang fa0122eaca selftests/mount_setattr: fix idmap_mount_tree_invalid failed to run
Test case idmap_mount_tree_invalid failed to run on the newer kernel
with the following output:

 #  RUN           mount_setattr_idmapped.idmap_mount_tree_invalid ...
 # mount_setattr_test.c:1428:idmap_mount_tree_invalid:Expected sys_mount_setattr(open_tree_fd, "", AT_EMPTY_PATH, &attr,  sizeof(attr)) (0) ! = 0 (0)
 # idmap_mount_tree_invalid: Test terminated by assertion

This is because tmpfs is mounted at "/mnt/A", and tmpfs already
contains the flag FS_ALLOW_IDMAP after the commit 7a80e5b8c6 ("shmem:
support idmapped mounts for tmpfs"). So calling sys_mount_setattr here
returns 0 instead of -EINVAL as expected.

Ramfs does not support idmap mounts, so we can use it here to test invalid mounts,
which allows the test case to pass with the following output:

 # Starting 1 tests from 1 test cases.
 #  RUN           mount_setattr_idmapped.idmap_mount_tree_invalid ...
 #            OK  mount_setattr_idmapped.idmap_mount_tree_invalid
 ok 1 mount_setattr_idmapped.idmap_mount_tree_invalid
 # PASSED: 1 / 1 tests passed.

Link: https://lore.kernel.org/all/20241028084132.3212598-1-zhouyuhang1010@163.com/
Signed-off-by: zhouyuhang <zhouyuhang@kylinos.cn>
Reviewed-by: Christian Brauner <brauner@kernel.org>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
2024-10-28 21:16:47 -06:00
..
crypto/chacha20-s390
cxl cxl: Move mailbox related bits to the same context 2024-09-12 08:38:01 -07:00
fault-injection failcmd: make failcmd.sh executable 2024-09-01 20:43:32 -07:00
ktest ktest.pl: Avoid false positives with grub2 skip regex 2024-09-04 15:06:28 -04:00
kunit kunit: tool: Build compile_commands.json 2024-09-12 09:52:36 -06:00
memblock memblock: updates for 6.12-rc1 2024-09-25 11:35:19 -07:00
nvdimm testing: nvdimm: Add MODULE_DESCRIPTION() macros 2024-06-17 18:43:08 -05:00
radix-tree memblock: updates for 6.12-rc1 2024-09-25 11:35:19 -07:00
scatterlist
selftests selftests/mount_setattr: fix idmap_mount_tree_invalid failed to run 2024-10-28 21:16:47 -06:00
shared 19 hotfixes. 13 are cc:stable. 2024-09-27 10:27:22 -07:00
vma mm: rework vm_ops->close() handling on VMA merge 2024-09-03 21:15:55 -07:00
vsock test/vsock: add ioctl unsent bytes test 2024-08-02 09:20:28 +01:00