aboutsummaryrefslogtreecommitdiff
path: root/weed/mount
diff options
context:
space:
mode:
authorwusong <75450248+wusongANKANG@users.noreply.github.com>2023-02-15 23:18:56 +0800
committerGitHub <noreply@github.com>2023-02-15 07:18:56 -0800
commit79af6b41d450d10f3eaa6c6de40d838610e73e9d (patch)
tree1eaf8c06baaae87e8f330711c4af0a806d24bc39 /weed/mount
parent896c6b8d1a7f99b2a9eba8cda4b0f71f5278613b (diff)
downloadseaweedfs-79af6b41d450d10f3eaa6c6de40d838610e73e9d.tar.xz
seaweedfs-79af6b41d450d10f3eaa6c6de40d838610e73e9d.zip
[mount] Fix read file-data in entry.content (#4207)
Diffstat (limited to 'weed/mount')
-rw-r--r--weed/mount/filehandle_read.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/weed/mount/filehandle_read.go b/weed/mount/filehandle_read.go
index be6d5d984..0684d0ba4 100644
--- a/weed/mount/filehandle_read.go
+++ b/weed/mount/filehandle_read.go
@@ -53,7 +53,7 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, int64, e
return 0, 0, io.EOF
}
- if offset+int64(len(buff)) <= int64(len(entry.Content)) {
+ if offset < int64(len(entry.Content)) {
totalRead := copy(buff, entry.Content[offset:])
glog.V(4).Infof("file handle read cached %s [%d,%d] %d", fileFullPath, offset, offset+int64(totalRead), totalRead)
return int64(totalRead), 0, nil