diff options
author | Brian Foster <bfoster@redhat.com> | 2020-02-26 20:43:16 +0300 |
---|---|---|
committer | Darrick J. Wong <darrick.wong@oracle.com> | 2020-03-03 07:55:51 +0300 |
commit | 211683b21de959a647de74faedfdd8a5d189327e (patch) | |
tree | 444365c8577f5cf8c9170a58e6c37d1dafd049a1 /fs/xfs/xfs_discard.h | |
parent | dd87f87d87fa4359a54e7b44549742f579e3e805 (diff) | |
download | linux-211683b21de959a647de74faedfdd8a5d189327e.tar.xz |
xfs: rework collapse range into an atomic operation
The collapse range operation uses a unique transaction and ilock
cycle for the hole punch and each extent shift iteration of the
overall operation. While the hole punch is safe as a separate
operation due to the iolock, cycling the ilock after each extent
shift is risky w.r.t. concurrent operations, similar to insert range.
To avoid this problem, make collapse range atomic with respect to
ilock. Hold the ilock across the entire operation, replace the
individual transactions with a single rolling transaction sequence
and finish dfops on each iteration to perform pending frees and roll
the transaction. Remove the unnecessary quota reservation as
collapse range can only ever merge extents (and thus remove extent
records and potentially free bmap blocks). The dfops call
automatically relogs the inode to keep it moving in the log. This
guarantees that nothing else can change the extent mapping of an
inode while a collapse range operation is in progress.
Signed-off-by: Brian Foster <bfoster@redhat.com>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Diffstat (limited to 'fs/xfs/xfs_discard.h')
0 files changed, 0 insertions, 0 deletions