aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2024-11-05 08:28:50 -0800
committerchrislu <chris.lu@gmail.com>2024-11-05 08:28:54 -0800
commit98b519b113955d1f9f26739707ba6d5ec83352cc (patch)
treed0c051d3a807cfa3961a8754d76e7237a31edd5c
parentefdebf712e0d8470d18c34297f1c2651207b1224 (diff)
downloadseaweedfs-98b519b113955d1f9f26739707ba6d5ec83352cc.tar.xz
seaweedfs-98b519b113955d1f9f26739707ba6d5ec83352cc.zip
fix FUSE mount on mac
-rw-r--r--weed/filer/reader_at.go5
1 files changed, 4 insertions, 1 deletions
diff --git a/weed/filer/reader_at.go b/weed/filer/reader_at.go
index d7617b740..5c52c8a2f 100644
--- a/weed/filer/reader_at.go
+++ b/weed/filer/reader_at.go
@@ -173,7 +173,7 @@ func (c *ChunkReadAt) doReadAt(p []byte, offset int64) (n int, ts int64, err err
// zero the remaining bytes if a gap exists at the end of the last chunk (or a fully sparse file)
if err == nil && remaining > 0 {
var delta int64
- if c.fileSize > startOffset {
+ if c.fileSize >= startOffset {
delta = min(remaining, c.fileSize-startOffset)
startOffset -= offset
} else {
@@ -220,6 +220,9 @@ func (c *ChunkReadAt) readChunkSliceAt(buffer []byte, chunkView *ChunkView, next
}
func zero(buffer []byte, start, length int64) int {
+ if length <= 0 {
+ return 0
+ }
end := min(start+length, int64(len(buffer)))
start = max(start, 0)