]> 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)
committerChristoph Hellwig <hch@lst.de>
Sun, 22 Sep 2024 08:01:29 +0000 (10:01 +0200)
commit8ecc102f1f5dd022ea003f26b37d805e745932e0
tree3782d7432c5f82f9db3e23b9ba43f014cbe127d1
parent04d345119197ec7ad697810c5702b61cf26f30a6
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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/libxfs/xfs_bmap.c