From e5d2e4b6d59f187d0fdbf365d67feba578f0d237 Mon Sep 17 00:00:00 2001 From: ryan Date: Sun, 16 Aug 2026 21:38:59 +0800 Subject: [PATCH] fix(linux): cast stat.Bsize to int64 for accurate calculations --- internal/apps/edge/observability/linux.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/internal/apps/edge/observability/linux.go b/internal/apps/edge/observability/linux.go index 2c5f7c2b..8f70f9d6 100644 --- a/internal/apps/edge/observability/linux.go +++ b/internal/apps/edge/observability/linux.go @@ -258,8 +258,8 @@ func StatFilesystem(path string) (int64, int64) { if err := syscall.Statfs(absPath, &stat); err != nil { return 0, 0 } - total := multiplyUint64Int64(stat.Blocks, stat.Bsize) - free := multiplyUint64Int64(stat.Bavail, stat.Bsize) + total := multiplyUint64Int64(stat.Blocks, int64(stat.Bsize)) + free := multiplyUint64Int64(stat.Bavail, int64(stat.Bsize)) used := max(total-free, 0) return total, used }