consider_older_record

Function consider_older_record 

Source
pub fn consider_older_record(
    current: Option<(u32, Stored)>,
    address: u32,
    bytes: &[u8; 2048],
    newer_than: u32,
) -> Option<(u32, Stored)>
Expand description

Consider one journal slot while looking for the newest committed record strictly older than newer_than.

This is how a boot walks back after the layer above rejects a record’s payload. consider_record recovers from a corrupt or uncommitted record, but a record whose CRC is fine and whose contents the session refuses would otherwise take the device to a bare boot while a readable older generation sits in the journal.

Re-scanning rather than retaining a runner-up during the first mount keeps that path’s “never buffers a second copy” discipline intact; the cost is paid only on a boot that is already going wrong.