mirror of
https://github.com/minio/minio.git
synced 2025-02-27 05:19:16 -05:00
Fail for disks which overflow upon usage calculation (#8056)
Fixes #8035
This commit is contained in:
parent
a48a034e5a
commit
aaef18b1a3
@ -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
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user