Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

libct/cg: IsCgroup2HybridMode: don't panic #3433

Merged
merged 1 commit into from
Mar 28, 2022

Commits on Mar 27, 2022

  1. 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 <kolyshkin@gmail.com>
    kolyshkin committed Mar 27, 2022
    Configuration menu
    Copy the full SHA
    d0c89df View commit details
    Browse the repository at this point in the history