aboutsummaryrefslogtreecommitdiff
path: root/weed/filesys/filehandle.go
diff options
context:
space:
mode:
authorChris Lu <chris.lu@gmail.com>2020-08-17 16:04:56 -0700
committerChris Lu <chris.lu@gmail.com>2020-08-17 16:04:56 -0700
commitabdaf9958d6d10a09246a9dc107db9f8dea9080b (patch)
tree8f5e7b8ad8f9a6bc50c54c8be6f2e41151a619b5 /weed/filesys/filehandle.go
parent9d46c7bc78987b1b02236030e9ca0af3f8c9e4f4 (diff)
downloadseaweedfs-abdaf9958d6d10a09246a9dc107db9f8dea9080b.tar.xz
seaweedfs-abdaf9958d6d10a09246a9dc107db9f8dea9080b.zip
possibly read more
Diffstat (limited to 'weed/filesys/filehandle.go')
-rw-r--r--weed/filesys/filehandle.go7
1 files changed, 5 insertions, 2 deletions
diff --git a/weed/filesys/filehandle.go b/weed/filesys/filehandle.go
index c3d49b16b..358475bd3 100644
--- a/weed/filesys/filehandle.go
+++ b/weed/filesys/filehandle.go
@@ -73,7 +73,10 @@ func (fh *FileHandle) Read(ctx context.Context, req *fuse.ReadRequest, resp *fus
return fuse.EIO
}
- totalRead = min(int64(len(buff)), totalRead)
+ if totalRead > int64(len(buff)) {
+ 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]
return err
@@ -102,7 +105,7 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, error) {
}
if fh.f.reader == nil {
- chunkViews := filer2.ViewFromVisibleIntervals(fh.f.entryViewCache, 0, math.MaxInt32)
+ chunkViews := filer2.ViewFromVisibleIntervals(fh.f.entryViewCache, 0, math.MaxInt64)
fh.f.reader = filer2.NewChunkReaderAtFromClient(fh.f.wfs, chunkViews, fh.f.wfs.chunkCache, fileSize)
}