From fce7ad481b61e5ed3b95a2a849d07ba9519cab16 Mon Sep 17 00:00:00 2001 From: Yu Watanabe Date: Mon, 5 Jan 2026 13:24:44 +0900 Subject: [PATCH] process-util: drop unnecessary E2BIG error handling E2BIG is returned when the kernel does not support CLONE_INTO_CGROUP, but the flag is supported since kernel v5.7. --- src/basic/process-util.c | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) diff --git a/src/basic/process-util.c b/src/basic/process-util.c index 1ff59dd374a..50118b60d92 100644 --- a/src/basic/process-util.c +++ b/src/basic/process-util.c @@ -2119,15 +2119,14 @@ int posix_spawn_wrapper( if (ERRNO_IS_NOT_SUPPORTED(r) && FLAGS_SET(flags, POSIX_SPAWN_SETCGROUP) && cg_is_threaded(cgroup) > 0) return -EUCLEAN; /* clone3() could also return EOPNOTSUPP if the target cgroup is in threaded mode, turn that into something recognizable */ - if ((ERRNO_IS_NOT_SUPPORTED(r) || ERRNO_IS_PRIVILEGE(r) || r == E2BIG) && + if ((ERRNO_IS_NOT_SUPPORTED(r) || ERRNO_IS_PRIVILEGE(r)) && FLAGS_SET(flags, POSIX_SPAWN_SETCGROUP)) { /* Compiled on a newer host, or seccomp&friends blocking clone3()? Fallback, but * need to disable POSIX_SPAWN_SETCGROUP, which is what redirects to clone3(). - * Note that we might get E2BIG here since some kernels (e.g. 5.4) support clone3() - * but not CLONE_INTO_CGROUP. */ - - /* CLONE_INTO_CGROUP definitely won't work, hence remember the fact so that we don't - * retry every time. */ + * CLONE_INTO_CGROUP definitely won't work, hence remember the fact so that we don't + * retry every time. + * Note, CLONE_INTO_CGROUP is supported since kernel v5.7, but some architectures still + * do not support clone3(). Hence, we need to keep the fallback logic for a while. */ have_clone_into_cgroup = false; flags &= ~POSIX_SPAWN_SETCGROUP; -- 2.47.3