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.

use ReadFull (#40) (#8240)

Feng Shao963398ac8c27
diff --git a/weed/shell/command_fs_meta_load.go b/weed/shell/command_fs_meta_load.go
index c2e01dfc2b..95c31ac554 100644
--- a/weed/shell/command_fs_meta_load.go
+++ b/weed/shell/command_fs_meta_load.go
@@ -98,7 +98,7 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.
var wg sync.WaitGroup
for {
- if n, err := dst.Read(sizeBuf); n != 4 {
+ if _, err := io.ReadFull(dst, sizeBuf); err != nil {
if err == io.EOF {
return nil
}
@@ -109,7 +109,7 @@ func (c *commandFsMetaLoad) Do(args []string, commandEnv *CommandEnv, writer io.
data := make([]byte, int(size))
- if n, err := dst.Read(data); n != len(data) {
+ if _, err := io.ReadFull(dst, data); err != nil {
return err
}