mount: use direct_io to avoid OS page cache

fix https://github.com/chrislusf/seaweedfs/issues/1752
This commit is contained in:
Chris Lu
2021-01-22 22:39:46 -08:00
parent 711c3f3939
commit 20ef3bb8d4
4 changed files with 21 additions and 2 deletions

View File

@@ -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
}