• Brian Foster's avatar
    xfs: simplify inode flush error handling · f2019299
    Brian Foster authored
    The inode flush code has several layers of error handling between
    the inode and cluster flushing code. If the inode flush fails before
    acquiring the backing buffer, the inode flush is aborted. If the
    cluster flush fails, the current inode flush is aborted and the
    cluster buffer is failed to handle the initial inode and any others
    that might have been attached before the error.
    
    Since xfs_iflush() is the only caller of xfs_iflush_cluster(), the
    error handling between the two can be condensed in the top-level
    function. If we update xfs_iflush_int() to always fall through to
    the log item update and attach the item completion handler to the
    buffer, any errors that occur after the first call to
    xfs_iflush_int() can be handled with a buffer I/O failure.
    
    Lift the error handling from xfs_iflush_cluster() into xfs_iflush()
    and consolidate with the existing error handling. This also replaces
    the need to release the buffer because failing the buffer with
    XBF_ASYNC drops the current reference.
    Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: default avatarChristoph Hellwig <hch@lst.de>
    Reviewed-by: default avatarAllison Collins <allison.henderson@oracle.com>
    Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
    f2019299
xfs_inode.c 107 KB