diff --git a/pkg/volume/testing/testing.go b/pkg/volume/testing/testing.go index a61a0c6f8d9..c6d32372264 100644 --- a/pkg/volume/testing/testing.go +++ b/pkg/volume/testing/testing.go @@ -1131,7 +1131,7 @@ func FindEmptyDirectoryUsageOnTmpfs() (*resource.Quantity, error) { return nil, err } defer os.RemoveAll(tmpDir) - out, err := exec.Command("nice", "-n", "19", "du", "-s", "-B", "1", tmpDir).CombinedOutput() + out, err := exec.Command("nice", "-n", "19", "du", "-x", "-s", "-B", "1", tmpDir).CombinedOutput() if err != nil { return nil, fmt.Errorf("failed command 'du' on %s with error %v", tmpDir, err) } diff --git a/pkg/volume/util/fs/fs.go b/pkg/volume/util/fs/fs.go index 21fb3a21e15..2796e93d19e 100644 --- a/pkg/volume/util/fs/fs.go +++ b/pkg/volume/util/fs/fs.go @@ -68,9 +68,9 @@ func DiskUsage(path string) (*resource.Quantity, error) { } // Uses the same niceness level as cadvisor.fs does when running du // Uses -B 1 to always scale to a blocksize of 1 byte - out, err := exec.Command("nice", "-n", "19", "du", "-s", "-B", "1", path).CombinedOutput() + out, err := exec.Command("nice", "-n", "19", "du", "-x", "-s", "-B", "1", path).CombinedOutput() if err != nil { - return nil, fmt.Errorf("failed command 'du' ($ nice -n 19 du -s -B 1) on path %s with error %v", path, err) + return nil, fmt.Errorf("failed command 'du' ($ nice -n 19 du -x -s -B 1) on path %s with error %v", path, err) } used, err := resource.ParseQuantity(strings.Fields(string(out))[0]) if err != nil {