• Kent Overstreet's avatar
    bcache: Journal replay fix · 5e20e8b3
    Kent Overstreet authored
    commit faa56736 upstream.
    
    The journal replay code starts by finding something that looks like a
    valid journal entry, then it does a binary search over the unchecked
    region of the journal for the journal entries with the highest sequence
    numbers.
    
    Trouble is, the logic was wrong - journal_read_bucket() returns true if
    it found journal entries we need, but if the range of journal entries
    we're looking for loops around the end of the journal - in that case
    journal_read_bucket() could return true when it hadn't found the highest
    sequence number we'd seen yet, and in that case the binary search did
    the wrong thing. Whoops.
    Signed-off-by: default avatarKent Overstreet <kmo@daterainc.com>
    Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
    5e20e8b3
journal.c 17.7 KB