diff --git a/pkg/disk/stat_linux.go b/pkg/disk/stat_linux.go index 66bddaef9..055c4242a 100644 --- a/pkg/disk/stat_linux.go +++ b/pkg/disk/stat_linux.go @@ -19,6 +19,7 @@ package disk import ( + "fmt" "syscall" ) @@ -37,5 +38,12 @@ func GetInfo(path string) (info Info, err error) { Ffree: uint64(s.Ffree), FSType: getFSType(int64(s.Type)), } + // Check for overflows. + // https://github.com/minio/minio/issues/8035 + // XFS can show wrong values at times error out + // in such scenarios. + if info.Free > info.Total { + return info, fmt.Errorf("detected free space (%d) > total disk space (%d), fs corruption at (%s). please run 'fsck'", info.Free, info.Total, path) + } return info, nil }