aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorTaylor Jackson <tjackson9431@gmail.com>2024-03-26 20:33:51 +0000
committerZorro Lang <zlang@kernel.org>2024-03-27 22:05:18 +0800
commitc4d6d42f2109a8447796436d7d1ba4e3fa5256b3 (patch)
treef88bcda3c154aa8d8ff06672f5c554bc74854eab
parent8d61144d281c49ba22581a16ac1010a38d3cc824 (diff)
downloadxfstests-dev-c4d6d42f2109a8447796436d7d1ba4e3fa5256b3.tar.gz
vfs/idmapped_mounts.c: Incorrect array index for nested user ns
Within the vfs test for idmapped mounts, the function nested_userns() is using an incorrect array index when attempting to set up the mapping for the 4th nested user ns within hierarchy[4]. The correct index that belongs to the 4th nested user ns is actually hierarchy[3]. And hierarchy[4] is reserved for the dummy entry that marks the end of the array. Signed-off-by: Taylor Jackson <tjackson9431@gmail.com> Reviewed-by: Christian Brauner <brauner@kernel.org> Signed-off-by: Zorro Lang <zlang@kernel.org>
-rw-r--r--src/vfs/idmapped-mounts.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/vfs/idmapped-mounts.c b/src/vfs/idmapped-mounts.c
index 547182fe19..34052ca387 100644
--- a/src/vfs/idmapped-mounts.c
+++ b/src/vfs/idmapped-mounts.c
@@ -6556,7 +6556,7 @@ static int nested_userns(const struct vfstest_info *info)
}
/* Don't write a mapping in the 4th userns. */
- list_empty(&hierarchy[4].id_map);
+ list_empty(&hierarchy[3].id_map);
/* Create the actual userns hierarchy. */
ret = create_userns_hierarchy(hierarchy);