diff --git a/extern/sector-storage/fsutil/filesize_unix.go b/extern/sector-storage/fsutil/filesize_unix.go index aadf93acc..7df8dae4c 100644 --- a/extern/sector-storage/fsutil/filesize_unix.go +++ b/extern/sector-storage/fsutil/filesize_unix.go @@ -21,7 +21,10 @@ func FileSize(path string) (SizeInfo, error) { return err } if !info.IsDir() { - stat := info.Sys().(*syscall.Stat_t) + stat, ok := info.Sys().(*syscall.Stat_t) + if !ok { + return xerrors.New("FileInfo.Sys of wrong type") + } // NOTE: stat.Blocks is in 512B blocks, NOT in stat.Blksize return SizeInfo{size}, nil // See https://www.gnu.org/software/libc/manual/html_node/Attribute-Meanings.html