|
@@ -26,8 +26,9 @@ func preallocExtend(f *os.File, sizeInBytes int64) error {
|
|
|
err := syscall.Fallocate(int(f.Fd()), 0, 0, sizeInBytes)
|
|
err := syscall.Fallocate(int(f.Fd()), 0, 0, sizeInBytes)
|
|
|
if err != nil {
|
|
if err != nil {
|
|
|
errno, ok := err.(syscall.Errno)
|
|
errno, ok := err.(syscall.Errno)
|
|
|
- // treat not support as nil error
|
|
|
|
|
- if ok && errno == syscall.ENOTSUP {
|
|
|
|
|
|
|
+ // not supported; fallback
|
|
|
|
|
+ // fallocate EINTRs frequently in some enviroments; fallback
|
|
|
|
|
+ if ok && (errno == syscall.ENOTSUP || errno == syscall.EINTR) {
|
|
|
return preallocExtendTrunc(f, sizeInBytes)
|
|
return preallocExtendTrunc(f, sizeInBytes)
|
|
|
}
|
|
}
|
|
|
}
|
|
}
|