diff options
| author | chrislu <chris.lu@gmail.com> | 2024-11-05 08:41:14 -0800 |
|---|---|---|
| committer | chrislu <chris.lu@gmail.com> | 2024-11-05 08:41:14 -0800 |
| commit | 6161d0b05db494e2d295487c893ebd432aaa5335 (patch) | |
| tree | 857190c30fbe7159f4ab05f5011394af9faa3cd4 /weed/mount | |
| parent | 98b519b113955d1f9f26739707ba6d5ec83352cc (diff) | |
| download | seaweedfs-6161d0b05db494e2d295487c893ebd432aaa5335.tar.xz seaweedfs-6161d0b05db494e2d295487c893ebd432aaa5335.zip | |
a bit optimization
Diffstat (limited to 'weed/mount')
| -rw-r--r-- | weed/mount/filehandle_read.go | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/weed/mount/filehandle_read.go b/weed/mount/filehandle_read.go index faf99952f..a609c97cc 100644 --- a/weed/mount/filehandle_read.go +++ b/weed/mount/filehandle_read.go @@ -47,6 +47,8 @@ func (fh *FileHandle) readFromChunks(buff []byte, offset int64) (int64, int64, e if fileSize == 0 { glog.V(1).Infof("empty fh %v", fileFullPath) return 0, 0, io.EOF + } else if offset == fileSize { + return 0, 0, io.EOF } else if offset >= fileSize { glog.V(1).Infof("invalid read, fileSize %d, offset %d for %s", fileSize, offset, fileFullPath) return 0, 0, io.EOF |
