]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs: fix xfs_bunmapi to allow unmapping of partial rt extents
authorDarrick J. Wong <djwong@kernel.org>
Mon, 22 Apr 2024 17:01:12 +0000 (10:01 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Mon, 3 Jun 2024 18:37:41 +0000 (11:37 -0700)
commitc2be7e836f670b84e0af30278f295e5eaaeaa3c4
tree51a0bd09ff5b398228f18f6665ff6f3abee21356
parent9e471add0671850b0305273c2604e66e1b30e102
xfs: fix xfs_bunmapi to allow unmapping of partial rt extents

Source kernel commit: 2b6a5ec26887cba195022286b039f2cc0ec683b1

When XFS_BMAPI_REMAP is passed to bunmapi, that means that we want to
remove part of a block mapping without touching the allocator.  For
realtime files with rtextsize > 1, that also means that we should skip
all the code that changes a partial remove request into an unwritten
extent conversion.  IOWs, bunmapi in this mode should handle removing
the mapping from the rt file and nothing else.

Note that XFS_BMAPI_REMAP callers are required to decrement the
reference count and/or free the space manually.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: Carlos Maiolino <cmaiolino@redhat.com>
libxfs/xfs_bmap.c