Skip readonly controllers

Some system have controller directories created, but they are
read-only. Handle that case and skip optional controllers.

Closes #5887

PiperOrigin-RevId: 411907208
This commit is contained in:
Fabricio Voznika
2021-11-23 15:25:50 -08:00
committed by gVisor bot
parent 2758e11230
commit 82fd0523dc
+2 -1
View File
@@ -20,6 +20,7 @@ import (
"bufio"
"context"
"encoding/json"
"errors"
"fmt"
"io"
"io/ioutil"
@@ -445,7 +446,7 @@ func createController(c Cgroup, name string) (bool, error) {
path := c.MakePath(name)
log.Debugf("Creating cgroup %q: %q", name, path)
if err := os.MkdirAll(path, 0755); err != nil {
return false, err
return errors.Is(err, unix.EROFS), err
}
return false, nil
}