]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: use realtime EFI to free extents when rtgroups are enabled
authorDarrick J. Wong <djwong@kernel.org>
Mon, 25 Nov 2024 21:14:24 +0000 (13:14 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 24 Dec 2024 02:01:30 +0000 (18:01 -0800)
commitf95f8a062de9c4c13817541d8ae0fd09ba0d331f
tree7e36c101b1a1001b4b34c42ff93e822225cf12c2
parente200799d5bbd43fba8e3ef51ca503a2a017f1a06
xfs: use realtime EFI to free extents when rtgroups are enabled

Source kernel commit: 44e69c9af159e61d4f765ff4805dd5b55f241597

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>
libxfs/xfs_bmap.c