From 6161d0b05db494e2d295487c893ebd432aaa5335 Mon Sep 17 00:00:00 2001 From: chrislu Date: Tue, 5 Nov 2024 08:41:14 -0800 Subject: [PATCH] a bit optimization --- weed/mount/filehandle_read.go | 2 ++ 1 file changed, 2 insertions(+) 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