diff --git a/fsutil/dealloc_other.go b/fsutil/dealloc_other.go index 3ae8973ff..4f8347951 100644 --- a/fsutil/dealloc_other.go +++ b/fsutil/dealloc_other.go @@ -13,5 +13,5 @@ var log = logging.Logger("fsutil") func Deallocate(file *os.File, offset int64, length int64) error { log.Warnf("deallocating space not supported") - return err + return nil } diff --git a/fsutil/filesize_unix.go b/fsutil/filesize_unix.go index d596e4be7..41b62daf6 100644 --- a/fsutil/filesize_unix.go +++ b/fsutil/filesize_unix.go @@ -20,6 +20,6 @@ func FileSize(path string) (SizeInfo, error) { // NOTE: stat.Blocks is in 512B blocks, NOT in stat.Blksize // See https://www.gnu.org/software/libc/manual/html_node/Attribute-Meanings.html return SizeInfo{ - stat.Blocks * 512, + int64(stat.Blocks) * 512, }, nil } diff --git a/fsutil/statfs_unix.go b/fsutil/statfs_unix.go index 3e69d5a8e..7fcb8af37 100644 --- a/fsutil/statfs_unix.go +++ b/fsutil/statfs_unix.go @@ -13,7 +13,7 @@ func Statfs(path string) (FsStat, error) { } return FsStat{ - Capacity: int64(stat.Blocks) * stat.Bsize, - Available: int64(stat.Bavail) * stat.Bsize, + Capacity: int64(stat.Blocks) * int64(stat.Bsize), + Available: int64(stat.Bavail) * int64(stat.Bsize), }, nil }