Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
libct/cg: IsCgroup2HybridMode: don't panic
In case statfs("/sys/fs/cgroup/unified") fails with any error other than ENOENT, current code panics. As IsCgroup2HybridMode is called from libcontainer/cgroups/fs's init function, this means that any user of libcontainer may panic during initialization, which is ugly. Avoid panicking; instead, do not enable hybrid hierarchy support and report the error (under debug level, not to confuse anyone). Basically, replace the panic with "turn off hybrid mode support" (which makes total sense since we were unable to statfs its root). Signed-off-by: Kir Kolyshkin <[email protected]>
- Loading branch information