• Kent Overstreet's avatar
    bcachefs: Improve journal entry validate code · 35ef6df5
    Kent Overstreet authored
    Previously, the journal entry read code was changed so that if we got a
    journal entry that failed validation, we'd try to use it, preferring to
    use a good version from another device if available.
    
    But this left a bug where if an earlier validation check (say, checksum)
    failed, the later checks (for last_seq) wouldn't run and we'd end up
    using a journal entry with a garbage last_seq field. This fixes that so
    that the later validation checks run and if necessary change those
    fields to something sensible.
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@gmail.com>
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    35ef6df5
journal_io.c 29.4 KB