mirror of
https://github.com/dennwc/btrfs
synced 2025-02-09 08:07:10 +00:00
send: fix diff int overflow
This commit is contained in:
parent
00defaf3f2
commit
cf180d91dc
6
send.go
6
send.go
@ -225,12 +225,12 @@ func findGoodParent(mnt *os.File, rootID objectID, cloneSrc []objectID) (objectI
|
|||||||
if err != nil {
|
if err != nil {
|
||||||
return 0, err
|
return 0, err
|
||||||
}
|
}
|
||||||
diff := parent2.CTransID - parent.CTransID
|
diff := int64(parent2.CTransID - parent.CTransID)
|
||||||
if diff < 0 {
|
if diff < 0 {
|
||||||
diff = -diff
|
diff = -diff
|
||||||
}
|
}
|
||||||
if diff < bestDiff {
|
if uint64(diff) < bestDiff {
|
||||||
bestParent, bestDiff = parent2, diff
|
bestParent, bestDiff = parent2, uint64(diff)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if bestParent == nil {
|
if bestParent == nil {
|
||||||
|
Loading…
Reference in New Issue
Block a user