|
|
@ -19,6 +19,7 @@ |
|
|
|
package disk |
|
|
|
package disk |
|
|
|
|
|
|
|
|
|
|
|
import ( |
|
|
|
import ( |
|
|
|
|
|
|
|
"fmt" |
|
|
|
"syscall" |
|
|
|
"syscall" |
|
|
|
) |
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
@ -37,5 +38,12 @@ func GetInfo(path string) (info Info, err error) { |
|
|
|
Ffree: uint64(s.Ffree), |
|
|
|
Ffree: uint64(s.Ffree), |
|
|
|
FSType: getFSType(int64(s.Type)), |
|
|
|
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 |
|
|
|
return info, nil |
|
|
|
} |
|
|
|
} |
|
|
|