Merge pull request #2305 from kolyshkin/fs2-fix-default

cgroupv2: fix fs2 driver default path
This commit is contained in:
Akihiro Suda 2020-04-16 10:16:48 +09:00 committed by GitHub
commit 9f6a2d4ddc
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 5 additions and 0 deletions

View File

@ -48,6 +48,11 @@ func defaultDirPath(c *configs.Cgroup) (string, error) {
if err != nil {
return "", err
}
// The current user scope most probably has tasks in it already,
// making it impossible to enable controllers for its sub-cgroup.
// A parent cgroup (with no tasks in it) is what we need.
ownCgroup = filepath.Dir(ownCgroup)
return _defaultDirPath(UnifiedMountpoint, cgPath, cgParent, cgName, ownCgroup)
}