• Brian Foster's avatar
    xfs: refactor xlog_cil_insert_items() to facilitate transaction dump · e2f23426
    Brian Foster authored
    Transaction reservation overrun detection currently occurs too late
    to print useful information about the offending transaction.
    Ideally, the transaction data is printed before the associated log
    items are moved from the transaction to the CIL, which occurs in
    xlog_cil_insert_items(), such that details of the items logged by
    the transaction are available for analysis.
    
    Refactor xlog_cil_insert_items() to facilitate moving tx overrun
    detection to this function. Update the function to track each bit of
    extra log reservation stolen from the transaction (i.e., such as for
    the CIL context ticket) and perform the log item migration as the
    last operation before the CIL lock is released. This creates a
    context where the transaction reservation consumption has been fully
    calculated when the log items are moved to the CIL. This patch makes
    no functional changes.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    e2f23426
xfs_log_cil.c 36.9 KB