From dd7d351114324d91f4ff29c769a89da5936bf0db Mon Sep 17 00:00:00 2001 From: Rodrigo Campos Date: Tue, 14 Mar 2023 12:45:08 +0100 Subject: [PATCH] vfs: Prepare tests in &s_idmapped_mounts to be reused inside a userns Future patches will call these tests within a userns. So, let's change the makedev major/minor to something that works inside a userns. Signed-off-by: Rodrigo Campos Reviewed-by: Christian Brauner Signed-off-by: Zorro Lang --- src/vfs/idmapped-mounts.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/vfs/idmapped-mounts.c b/src/vfs/idmapped-mounts.c index ed7948b6..eb0df938 100644 --- a/src/vfs/idmapped-mounts.c +++ b/src/vfs/idmapped-mounts.c @@ -535,7 +535,7 @@ static int fsids_mapped(const struct vfstest_info *info) die("failure: create"); /* create character device */ - if (mknodat(open_tree_fd, CHRDEV1, S_IFCHR | 0644, makedev(5, 1))) + if (mknodat(open_tree_fd, CHRDEV1, S_IFCHR | 0644, makedev(0, 0))) die("failure: create"); /* create symlink */ @@ -764,7 +764,7 @@ static int expected_uid_gid_idmapped_mounts(const struct vfstest_info *info) } /* create character device */ - if (mknodat(info->t_dir1_fd, CHRDEV1, S_IFCHR | 0644, makedev(5, 1))) { + if (mknodat(info->t_dir1_fd, CHRDEV1, S_IFCHR | 0644, makedev(0, 0))) { log_stderr("failure: mknodat"); goto out; } -- 2.39.5