]> www.infradead.org Git - users/hch/xfs.git/commit
xfs: use realtime EFI to free extents when rtgroups are enabled
authorDarrick J. Wong <djwong@kernel.org>
Thu, 15 Aug 2024 18:48:22 +0000 (11:48 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Fri, 16 Aug 2024 21:54:17 +0000 (14:54 -0700)
commit6882b12d42ef97b64a96cb41ad5386d3d169dad4
treefb014ef1b85fb20950a79a1d3d82696985e6bb51
parenta416c38299dc6d7e747b9f005bcddc9bd2c01909
xfs: use realtime EFI to free extents when rtgroups are enabled

When rmap is enabled, XFS expects a certain order of operations, which
is: 1) remove the file mapping, 2) remove the reverse mapping, and then
3) free the blocks.  When reflink is enabled, XFS replaces (3) with a
deferred refcount decrement operation that can schedule freeing the
blocks if that was the last refcount.

For realtime files, xfs_bmap_del_extent_real tries to do 1 and 3 in the
same transaction, which will break both rmap and reflink unless we
switch it to use realtime EFIs.  Both rmap and reflink depend on the
rtgroups feature, so let's turn on EFIs for all rtgroups filesystems.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
fs/xfs/libxfs/xfs_bmap.c