ca446d880c
The file collapse mechanism uses xfs_bmap_shift_extents() to collapse all subsequent extents down into the specified, previously punched out, region. This function performs some validation, such as whether a sufficient hole exists in the target region of the collapse, then shifts the remaining exents downward. The exit path of the function currently logs the inode unconditionally. While we must log the inode (and abort) if an error occurs and the transaction is dirty, the initial validation paths can generate errors before the transaction has been dirtied. This creates an unnecessary filesystem shutdown scenario, as the caller will cancel a transaction that has been marked dirty. Modify xfs_bmap_shift_extents() to OR the logflags bits as modifications are made to the inode bmap. Only log the inode in the exit path if logflags has been set. This ensures we only have to cancel a dirty transaction if modifications have been made and prevents an unnecessary filesystem shutdown otherwise. Signed-off-by: Brian Foster <bfoster@redhat.com> Reviewed-by: Dave Chinner <dchinner@redhat.com> Reviewed-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Dave Chinner <david@fromorbit.com> |
||
---|---|---|
.. | ||
xfs_ag.h | ||
xfs_alloc.c | ||
xfs_alloc.h | ||
xfs_alloc_btree.c | ||
xfs_alloc_btree.h | ||
xfs_attr.c | ||
xfs_attr_leaf.c | ||
xfs_attr_leaf.h | ||
xfs_attr_remote.c | ||
xfs_attr_remote.h | ||
xfs_attr_sf.h | ||
xfs_bit.h | ||
xfs_bmap.c | ||
xfs_bmap.h | ||
xfs_bmap_btree.c | ||
xfs_bmap_btree.h | ||
xfs_btree.c | ||
xfs_btree.h | ||
xfs_cksum.h | ||
xfs_da_btree.c | ||
xfs_da_btree.h | ||
xfs_da_format.c | ||
xfs_da_format.h | ||
xfs_dinode.h | ||
xfs_dir2.c | ||
xfs_dir2.h | ||
xfs_dir2_block.c | ||
xfs_dir2_data.c | ||
xfs_dir2_leaf.c | ||
xfs_dir2_node.c | ||
xfs_dir2_priv.h | ||
xfs_dir2_sf.c | ||
xfs_dquot_buf.c | ||
xfs_format.h | ||
xfs_ialloc.c | ||
xfs_ialloc.h | ||
xfs_ialloc_btree.c | ||
xfs_ialloc_btree.h | ||
xfs_inode_buf.c | ||
xfs_inode_buf.h | ||
xfs_inode_fork.c | ||
xfs_inode_fork.h | ||
xfs_inum.h | ||
xfs_log_format.h | ||
xfs_log_recover.h | ||
xfs_log_rlimit.c | ||
xfs_quota_defs.h | ||
xfs_rtbitmap.c | ||
xfs_sb.c | ||
xfs_sb.h | ||
xfs_shared.h | ||
xfs_symlink_remote.c | ||
xfs_trans_resv.c | ||
xfs_trans_resv.h | ||
xfs_trans_space.h |