Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

blocks count

chrislu5e814afe8810
diff --git a/weed/filesys/file.go b/weed/filesys/file.go
index 48a024f206..8028d39128 100644
--- a/weed/filesys/file.go
+++ b/weed/filesys/file.go
@@ -72,8 +72,8 @@ func (file *File) Attr(ctx context.Context, attr *fuse.Attr) (err error) {
attr.Mtime = time.Unix(entry.Attributes.Mtime, 0)
attr.Gid = entry.Attributes.Gid
attr.Uid = entry.Attributes.Uid
- attr.Blocks = attr.Size/blockSize + 1
- attr.BlockSize = uint32(file.wfs.option.ChunkSizeLimit)
+ attr.BlockSize = blockSize
+ attr.Blocks = (attr.Size + blockSize - 1) / blockSize
if entry.HardLinkCounter > 0 {
attr.Nlink = uint32(entry.HardLinkCounter)
}