fix FUSE read for large files

FUSE expects ReadAt do not return partial filled buffer with a nil error.
This commit is contained in:
Chris Lu
2020-03-27 04:50:51 -07:00
parent f06ca04451
commit d1439c5bd3
5 changed files with 135 additions and 45 deletions

View File

@@ -34,7 +34,7 @@ type File struct {
entry *filer_pb.Entry
entryViewCache []filer2.VisibleInterval
isOpen int
reader io.ReadSeeker
reader io.ReaderAt
}
func (file *File) fullpath() util.FullPath {
@@ -249,6 +249,7 @@ func (file *File) addChunks(chunks []*filer_pb.FileChunk) {
file.entryViewCache = newVisibles
newVisibles = t
}
file.reader = nil
glog.V(3).Infof("%s existing %d chunks adds %d more", file.fullpath(), len(file.entry.Chunks), len(chunks))