aboutsummaryrefslogtreecommitdiff
path: root/weed/filer/filechunk_group.go
diff options
context:
space:
mode:
Diffstat (limited to 'weed/filer/filechunk_group.go')
-rw-r--r--weed/filer/filechunk_group.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/weed/filer/filechunk_group.go b/weed/filer/filechunk_group.go
index dbeb54ce8..ebda62845 100644
--- a/weed/filer/filechunk_group.go
+++ b/weed/filer/filechunk_group.go
@@ -1,6 +1,7 @@
package filer
import (
+ "io"
"sync"
"github.com/seaweedfs/seaweedfs/weed/pb/filer_pb"
@@ -44,6 +45,9 @@ func (group *ChunkGroup) AddChunk(chunk *filer_pb.FileChunk) error {
}
func (group *ChunkGroup) ReadDataAt(fileSize int64, buff []byte, offset int64) (n int, tsNs int64, err error) {
+ if offset >= fileSize {
+ return 0, 0, io.EOF
+ }
group.sectionsLock.RLock()
defer group.sectionsLock.RUnlock()