diff options
author | Brian Foster <bfoster@redhat.com> | 2014-09-02 12:12:53 +1000 |
---|---|---|
committer | Dave Chinner <david@fromorbit.com> | 2014-09-02 12:12:53 +1000 |
commit | ca446d880c399bb31301e7d8eefbd7fe3c504c4e (patch) | |
tree | f56c1744deb58bf8c047793c40c851ad06650fca /fs/xfs/xfs_ioctl.h | |
parent | 7d4ea3ce63a6bc532abb334c469c18481798af8c (diff) | |
download | blackbird-op-linux-ca446d880c399bb31301e7d8eefbd7fe3c504c4e.tar.gz blackbird-op-linux-ca446d880c399bb31301e7d8eefbd7fe3c504c4e.zip |
xfs: don't log inode unless extent shift makes extent modifications
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>
Diffstat (limited to 'fs/xfs/xfs_ioctl.h')
0 files changed, 0 insertions, 0 deletions