From: Yang Xu Date: Sat, 7 May 2022 16:01:25 +0000 (+0800) Subject: idmapped-mounts: Reset errno to zero before run_test X-Git-Tag: v2022.05.08~2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=6ac390bb605b70ef9d12eff9742379e13cfe0cd6;p=xfstests-dev.git idmapped-mounts: Reset errno to zero before run_test If we run case on old kernel that doesn't support mount_setattr and then fail on our own function before call is_setgid/is_setuid function to reset errno, run_test will print "Function not implement" error. We also check whether system support user namespace, so reset errno to zero after userns check. Acked-by: Christian Brauner (Microsoft) Signed-off-by: Yang Xu Signed-off-by: Zorro Lang --- diff --git a/src/idmapped-mounts/idmapped-mounts.c b/src/idmapped-mounts/idmapped-mounts.c index ce3f73be..2e94bf71 100644 --- a/src/idmapped-mounts/idmapped-mounts.c +++ b/src/idmapped-mounts/idmapped-mounts.c @@ -14232,6 +14232,8 @@ int main(int argc, char *argv[]) exit(EXIT_SUCCESS); } t_has_userns = sys_has_userns(); + /* don't copy ENOSYS errno to child process on older kernel */ + errno = 0; stash_overflowuid(); stash_overflowgid();