From ed11bb90f0a775e91f9ae64e3be951a47cd642c3 Mon Sep 17 00:00:00 2001 From: Dmitry Vyukov Date: Wed, 13 Oct 2021 07:48:34 +0200 Subject: executor: don't fail on cgroup mounting On stretch images setup_cgroups fails as: mount(/syzcgroup/net, net) failed: 22 mount(/syzcgroup/net, net_cls) failed: 22 mount(/syzcgroup/net, net_prio) failed: 22 mount(/syzcgroup/net, blkio) failed: 22 SYZFAIL: mount cgroup failed (/syzcgroup/net, devices,freezer): 16 (errno 16: Device or resource busy) It seems that systemd starts messing with these mounts somehow and repeated mounting fails with EBUSY. Don't hard fail on that error. --- executor/common_linux.h | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'executor') diff --git a/executor/common_linux.h b/executor/common_linux.h index 16880d00e..43fb6c2ce 100644 --- a/executor/common_linux.h +++ b/executor/common_linux.h @@ -3472,8 +3472,12 @@ static void mount_cgroups(const char* dir, const char** controllers, int count) if (enabled[0] == 0) return; // Now mount all at once. - if (mount("none", dir, "cgroup", 0, enabled + 1)) - failmsg("mount cgroup failed", "(%s, %s): %d\n", dir, enabled + 1, errno); + if (mount("none", dir, "cgroup", 0, enabled + 1)) { + // In systemd/stretch images this is failing with EBUSY + // (systemd starts messing with these mounts?), + // so we don't fail, but just log the error. + debug("mount(%s, %s) failed: %d\n", dir, enabled + 1, errno); + } if (chmod(dir, 0777)) { debug("chmod(%s) failed: %d\n", dir, errno); } -- cgit mrf-deployment