Browse Source

fix FUSE mount on mac

pull/6214/head
chrislu 2 months ago
parent
commit
98b519b113
  1. 5
      weed/filer/reader_at.go

5
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) // 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 { if err == nil && remaining > 0 {
var delta int64 var delta int64
if c.fileSize > startOffset {
if c.fileSize >= startOffset {
delta = min(remaining, c.fileSize-startOffset) delta = min(remaining, c.fileSize-startOffset)
startOffset -= offset startOffset -= offset
} else { } else {
@ -220,6 +220,9 @@ func (c *ChunkReadAt) readChunkSliceAt(buffer []byte, chunkView *ChunkView, next
} }
func zero(buffer []byte, start, length int64) int { func zero(buffer []byte, start, length int64) int {
if length <= 0 {
return 0
}
end := min(start+length, int64(len(buffer))) end := min(start+length, int64(len(buffer)))
start = max(start, 0) start = max(start, 0)

Loading…
Cancel
Save