From 866c2657f08785e67a024ed51f1ef5bc9c5c26d3 Mon Sep 17 00:00:00 2001 From: chrislu Date: Sun, 19 Dec 2021 23:13:36 -0800 Subject: [PATCH] avoid FUSE cache only for the first 512 bytes --- weed/filesys/filehandle.go | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go index 4f7b7f37e..98b92cc50 100644 --- a/weed/filesys/filehandle.go +++ b/weed/filesys/filehandle.go @@ -174,7 +174,7 @@ func (fh *FileHandle) Write(ctx context.Context, req *fuse.WriteRequest, resp *f // write the request to volume servers data := req.Data - if len(data) <= 512 { + if len(data) <= 512 && req.Offset == 0 { // fuse message cacheable size data = make([]byte, len(req.Data)) copy(data, req.Data)