Skip to content

Commit

Permalink
fix zero part patch
Browse files Browse the repository at this point in the history
  • Loading branch information
Aleksandr Snopov committed May 6, 2024
1 parent 51972d0 commit 83b3214
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion internal/file.go
Original file line number Diff line number Diff line change
Expand Up @@ -1116,7 +1116,11 @@ func (inode *Inode) patchObjectRanges() (initiated bool) {
return false
}

_, prevSize := inode.fs.partRange(MaxUInt64(part-1, 0))
var prevPart uint64
if part > 0 {
prevPart = part - 1
}
_, prevSize := inode.fs.partRange(prevPart)

partEnd, rangeBorder := partStart+partSize, partSize != prevSize
appendPatch, newPart := partEnd > inode.knownSize, partStart == inode.knownSize
Expand Down

0 comments on commit 83b3214

Please sign in to comment.