scripts: Added better branch cksum checks
If we're fetching branches anyways, we might as well check that the checksums match. This helps protect against infinite loops in B-tree branches. Also fixed an issue where we weren't xoring perturb state on finding an explicit trunk. Note this is equivalent to LFS_M_CKFETCHES in lfs.c. --- This doesn't mean we always need LFS_M_CKFETCHES. Our dbg scripts just need to be a little bit tougher because 1. running tests with -j creates wildly corrupted and entangled littlefs images, and 2. Rbyd.fetch is almost too forgiving in choosing the nearest trunk.
This commit is contained in:
+2
-1
@@ -1003,7 +1003,8 @@ def main(disk, blocks=None, *,
|
||||
if trunk and j_ + size > trunk:
|
||||
eoff_ = j_ + size
|
||||
eoff = eoff_
|
||||
cksum = cksum_
|
||||
cksum = cksum__ ^ (
|
||||
0xfca42daf if perturb else 0)
|
||||
trunk_ = trunk__
|
||||
weight = weight_
|
||||
trunk___ = 0
|
||||
|
||||
Reference in New Issue
Block a user