Commit fa0122e
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 7a80e5b ("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/[email protected]/
Signed-off-by: zhouyuhang <[email protected]>
Reviewed-by: Christian Brauner <[email protected]>
Signed-off-by: Shuah Khan <[email protected]>1 parent fe05c40 commit fa0122e
1 file changed
+9
-0
lines changedLines changed: 9 additions & 0 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1414 | 1414 | | |
1415 | 1415 | | |
1416 | 1416 | | |
| 1417 | + | |
| 1418 | + | |
| 1419 | + | |
| 1420 | + | |
| 1421 | + | |
| 1422 | + | |
| 1423 | + | |
1417 | 1424 | | |
1418 | 1425 | | |
1419 | 1426 | | |
| |||
1433 | 1440 | | |
1434 | 1441 | | |
1435 | 1442 | | |
| 1443 | + | |
| 1444 | + | |
1436 | 1445 | | |
1437 | 1446 | | |
1438 | 1447 | | |
| |||
0 commit comments