Expand description
fsck rules for a manifest/object graph.
Every rule has a name. A corrupt graph is not merely “invalid” — fsck says which invariant broke and at which node, because the operator response differs: a digest mismatch means the bytes are wrong, a dangling ref means publication tore, and an extent gap means a grant would authorize bytes nobody selected.
The rules divide into four families:
- Well-formed — every reachable node decodes canonically
(
FsckRule::MalformedNode,FsckRule::NonCanonicalNodeEncoding,FsckRule::LeafEntriesOutOfOrder, …). - Digests match — node bytes hash to the address they were fetched by, subtree summaries equal what the subtree actually holds, and every encoded pack record hashes to its declared digest.
- No dangling refs — every branch child resolves, every leaf object is present in the object index, and no grant names an object the manifest does not cover.
- Gap-free coverage — a pack range’s records partition
[start, end)exactly, in offset-canonical order, with no gap and no overlap.
fsck is checking, not repair, and it is total: it collects every finding rather than bailing at the first, so one run tells an operator the whole story. Traversal is still bounded — visited nodes are not re-entered and depth cannot exceed the fixed route — so an adversarial node set cannot make it spin.
Structs§
- Fsck
Finding - One violation: the rule, where it was found, and a human-readable detail.
- Fsck
Options - What fsck should check beyond node structure.
- Fsck
Report - Every finding from one fsck run.
- Pack
Range Audit - What to check a pack claim against, beyond its own structure.
Enums§
- Fsck
Rule - The named integrity rules fsck enforces.
Traits§
- Manifest
Object Index - The set of content objects a manifest may legally name, with their decoded sizes.
Functions§
- fsck_
manifest - Check a manifest graph rooted at
rootfor structure and digests only. - fsck_
manifest_ store - Check every root in
rootsagainst a whole node store, additionally reporting nodes no root reaches. - fsck_
manifest_ with - Check a manifest graph rooted at
root, with optional object and reachability checks. - fsck_
pack_ range - Check that a coalesced pack range is offset-canonical, gap-free, and — when the caller supplies them — digest-correct and manifest-covered.