diff options
Diffstat (limited to 'weed/filesys/filehandle.go')
| -rw-r--r-- | weed/filesys/filehandle.go | 9 |
1 files changed, 6 insertions, 3 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 372d742ea..3386256f9 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -3,6 +3,7 @@ package filesys import ( "context" "fmt" + "io" "math" "net/http" "time" @@ -98,6 +99,10 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) { totalRead, err := fh.f.reader.ReadAt(buff, offset) + if err == io.EOF { + err = nil + } + if err != nil { glog.Errorf("file handle read %s: %v", fh.f.fullpath(), err) } @@ -209,9 +214,7 @@ func (fh *FileHandle) Flush(ctx context.Context, req *fuse.FlushRequest) error { return fmt.Errorf("fh flush create %s: %v", fh.f.fullpath(), err) } - if fh.f.wfs.option.AsyncMetaDataCaching { - fh.f.wfs.metaCache.InsertEntry(context.Background(), filer2.FromPbEntry(request.Directory, request.Entry)) - } + fh.f.wfs.metaCache.InsertEntry(context.Background(), filer2.FromPbEntry(request.Directory, request.Entry)) fh.f.wfs.deleteFileChunks(garbages) for i, chunk := range garbages { |
