aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/filehandle.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2021-01-22 22:39:46 -0800
committerChris Lu <chris.lu@gmail.com>2021-01-22 22:39:46 -0800
commit20ef3bb8d4e228cdcd2c81c46c98ffb95a6398aa (patch)
tree9a37eb15554ab553c7983653712ab07ad70b5cab /weed/filesys/filehandle.go
parent711c3f393980f96971904d52d078e8f272451374 (diff)
downloadseaweedfs-20ef3bb8d4e228cdcd2c81c46c98ffb95a6398aa.tar.xz
seaweedfs-20ef3bb8d4e228cdcd2c81c46c98ffb95a6398aa.zip
mount: use direct_io to avoid OS page cache
fix https://github.com/chrislusf/seaweedfs/issues/1752
Diffstat (limited to 'weed/filesys/filehandle.go')
-rw-r--r--weed/filesys/filehandle.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index d5f6cc38e..6225ab968 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -90,8 +90,9 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus
glog.Warningf("%s FileHandle Read %d: [%d,%d) size %d totalRead %d", fh.f.fullpath(), fh.handle, req.Offset, req.Offset+int64(req.Size), req.Size, totalRead)
totalRead = min(int64(len(buff)), totalRead)
}
- // resp.Data = buff[:totalRead]
- resp.Data = buff
+ if err == nil {
+ resp.Data = buff[:totalRead]
+ }
return err
}