• Brian Foster's avatar
    bcachefs: refactor journal stuck checking into standalone helper · db1bf729
    Brian Foster authored
    bcachefs checks for journal stuck conditions both in the journal
    space calculation code and the journal reservation slow path. The
    logic in both places is rather tricky and can result in
    non-deterministic failure characteristics and debug output.
    
    In preparation to condense journal stuck handling to a single place,
    refactor the __journal_res_get() logic into a standalone helper.
    Since multiple callers into the reservation code can result in
    duplicate reports, use the ->err_seq field as a serialization
    mechanism for the debug dump. Finally, add some comments to help
    explain the logic and hopefully facilitate further improvements in
    the future.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Signed-off-by: default avatarKent Overstreet <kent.overstreet@linux.dev>
    db1bf729
journal.c 35.6 KB