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.

fix get file stats for IsEmpty (#4576)

Konstantin Lebedev1e22d5caf2f3
diff --git a/weed/storage/volume.go b/weed/storage/volume.go
index 066f06604a..79b0059d6e 100644
--- a/weed/storage/volume.go
+++ b/weed/storage/volume.go
@@ -333,6 +333,6 @@ func (v *Volume) IsReadOnly() bool {
return v.noWriteOrDelete || v.noWriteCanDelete || v.location.isDiskSpaceLow
}
func (v *Volume) IsEmpty() bool {
- size, _, _ := v.DataBackend.GetStat()
- return size <= 8 && v.ContentSize() == 0
+ datSize, _, _ := v.FileStat()
+ return datSize <= super_block.SuperBlockSize && v.ContentSize() == 0
}