Unverified Commit a0f38dbf by Stéphane Graber Committed by GitHub

Merge pull request #3891 from brauner/2021-07-01.fixes

cgroups: handle funky cgroup layouts
parents d31bfd24 f4afdfbe
...@@ -3194,8 +3194,15 @@ static int __initialize_cgroups(struct cgroup_ops *ops, bool relative, ...@@ -3194,8 +3194,15 @@ static int __initialize_cgroups(struct cgroup_ops *ops, bool relative,
dfd_base = open_at(dfd_mnt, current_cgroup, dfd_base = open_at(dfd_mnt, current_cgroup,
PROTECT_OPATH_DIRECTORY, PROTECT_OPATH_DIRECTORY,
PROTECT_LOOKUP_BENEATH_XDEV, 0); PROTECT_LOOKUP_BENEATH_XDEV, 0);
if (dfd_base < 0) if (dfd_base < 0) {
return syserror("Failed to open %d/%s", dfd_mnt, current_cgroup); if (errno != ENOENT)
return syserror("Failed to open %d/%s",
dfd_mnt, current_cgroup);
SYSTRACE("Current cgroup %d/%s does not exist (funky cgroup layout?)",
dfd_mnt, current_cgroup);
continue;
}
dfd = dfd_base; dfd = dfd_base;
} }
...@@ -3265,9 +3272,15 @@ static int __initialize_cgroups(struct cgroup_ops *ops, bool relative, ...@@ -3265,9 +3272,15 @@ static int __initialize_cgroups(struct cgroup_ops *ops, bool relative,
dfd_base = open_at(dfd_mnt, current_cgroup, dfd_base = open_at(dfd_mnt, current_cgroup,
PROTECT_OPATH_DIRECTORY, PROTECT_OPATH_DIRECTORY,
PROTECT_LOOKUP_BENEATH_XDEV, 0); PROTECT_LOOKUP_BENEATH_XDEV, 0);
if (dfd_base < 0) if (dfd_base < 0) {
if (errno != ENOENT)
return syserror("Failed to open %d/%s", return syserror("Failed to open %d/%s",
dfd_mnt, current_cgroup); dfd_mnt, current_cgroup);
SYSTRACE("Current cgroup %d/%s does not exist (funky cgroup layout?)",
dfd_mnt, current_cgroup);
continue;
}
dfd = dfd_base; dfd = dfd_base;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment