Skip to content

Commit

Permalink
Merge pull request #3435 from mrunalp/dont_panic_1.1
Browse files Browse the repository at this point in the history
[release-1.1] libct/cg: IsCgroup2HybridMode: don't panic
  • Loading branch information
Mrunal Patel committed Mar 28, 2022
2 parents 6f48ab3 + 8290c4c commit 6bf0a56
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions libcontainer/cgroups/utils.go
Expand Up @@ -55,12 +55,12 @@ func IsCgroup2HybridMode() bool {
var st unix.Statfs_t
err := unix.Statfs(hybridMountpoint, &st)
if err != nil {
if os.IsNotExist(err) {
// ignore the "not found" error
isHybrid = false
return
isHybrid = false
if !os.IsNotExist(err) {
// Report unexpected errors.
logrus.WithError(err).Debugf("statfs(%q) failed", hybridMountpoint)
}
panic(fmt.Sprintf("cannot statfs cgroup root: %s", err))
return
}
isHybrid = st.Type == unix.CGROUP2_SUPER_MAGIC
})
Expand Down

0 comments on commit 6bf0a56

Please sign in to comment.