• Brian Foster's avatar
    xfs: rework log recovery to submit buffers on LSN boundaries · 12818d24
    Brian Foster authored
    The fix to log recovery to update the metadata LSN in recovered buffers
    introduces the requirement that a buffer is submitted only once per
    current LSN. Log recovery currently submits buffers on transaction
    boundaries. This is not sufficient as the abstraction between log
    records and transactions allows for various scenarios where multiple
    transactions can share the same current LSN. If independent transactions
    share an LSN and both modify the same buffer, log recovery can
    incorrectly skip updates and leave the filesystem in an inconsisent
    state.
    
    In preparation for proper metadata LSN updates during log recovery,
    update log recovery to submit buffers for write on LSN change boundaries
    rather than transaction boundaries. Explicitly track the current LSN in
    a new struct xlog field to handle the various corner cases of when the
    current LSN may or may not change.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDave Chinner <dchinner@redhat.com>
    Signed-off-by: default avatarDave Chinner <david@fromorbit.com>
    12818d24
xfs_log_priv.h 22.2 KB