Skip to content

Commit 25269ef

Browse files
committed
Fix building on arm64
github.com/containerd/continuity/fs fs/du_unix.go:66:31: invalid operation: stat.Blocks * stat.Blksize (mismatched types int64 and int32) fs/du_unix.go:97:31: invalid operation: stat.Blocks * stat.Blksize (mismatched types int64 and int32) Signed-off-by: Shengjing Zhu <[email protected]>
1 parent 310e183 commit 25269ef

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

fs/du_unix.go

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,8 @@ func diskUsage(ctx context.Context, roots ...string) (Usage, error) {
6363
inoKey := newInode(stat)
6464
if _, ok := inodes[inoKey]; !ok {
6565
inodes[inoKey] = struct{}{}
66-
size += stat.Blocks * stat.Blksize
66+
// on arm64 stat.Blksize is int32
67+
size += stat.Blocks * int64(stat.Blksize) // nolint: unconvert
6768
}
6869

6970
return nil
@@ -94,7 +95,8 @@ func diffUsage(ctx context.Context, a, b string) (Usage, error) {
9495
inoKey := newInode(stat)
9596
if _, ok := inodes[inoKey]; !ok {
9697
inodes[inoKey] = struct{}{}
97-
size += stat.Blocks * stat.Blksize
98+
// on arm64 stat.Blksize is int32
99+
size += stat.Blocks * int64(stat.Blksize) // nolint: unconvert
98100
}
99101

100102
return nil

0 commit comments

Comments
 (0)