summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDarrick J. Wong <djwong@kernel.org>2025-10-20 11:49:51 -0400
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2025-10-23 16:20:41 +0200
commit88ad39711bfb557249c238272f8dfb0c41b3f36f (patch)
treeb19aeb77eb3fa46cc66eb2302d2ae1e25923f728
parente9fd43b799d231319e1d00b05bd8310f0dadc99d (diff)
downloadlinux-88ad39711bfb557249c238272f8dfb0c41b3f36f.tar.gz
linux-88ad39711bfb557249c238272f8dfb0c41b3f36f.tar.bz2
linux-88ad39711bfb557249c238272f8dfb0c41b3f36f.zip
xfs: use deferred intent items for reaping crosslinked blocks
[ Upstream commit cd32a0c0dcdf634f2e0e71f41c272e19dece6264 ] When we're removing rmap records for crosslinked blocks, use deferred intent items so that we can try to free/unmap as many of the old data structure's blocks as we can in the same transaction as the commit. Cc: <stable@vger.kernel.org> # v6.6 Fixes: 1c7ce115e52106 ("xfs: reap large AG metadata extents when possible") Signed-off-by: "Darrick J. Wong" <djwong@kernel.org> Reviewed-by: Christoph Hellwig <hch@lst.de> [ adapted xfs_refcount_free_cow_extent() and xfs_rmap_free_extent() ] Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r--fs/xfs/scrub/reap.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/fs/xfs/scrub/reap.c b/fs/xfs/scrub/reap.c
index 53697f3c5e1b..8688edec5875 100644
--- a/fs/xfs/scrub/reap.c
+++ b/fs/xfs/scrub/reap.c
@@ -409,8 +409,6 @@ xreap_agextent_iter(
if (crosslinked) {
trace_xreap_dispose_unmap_extent(sc->sa.pag, agbno, *aglenp);
- rs->force_roll = true;
-
if (rs->oinfo == &XFS_RMAP_OINFO_COW) {
/*
* If we're unmapping CoW staging extents, remove the
@@ -418,11 +416,14 @@ xreap_agextent_iter(
* rmap record as well.
*/
xfs_refcount_free_cow_extent(sc->tp, fsbno, *aglenp);
+ rs->force_roll = true;
return 0;
}
- return xfs_rmap_free(sc->tp, sc->sa.agf_bp, sc->sa.pag, agbno,
- *aglenp, rs->oinfo);
+ xfs_rmap_free_extent(sc->tp, sc->sa.pag->pag_agno, agbno,
+ *aglenp, rs->oinfo->oi_owner);
+ rs->deferred++;
+ return 0;
}
trace_xreap_dispose_free_extent(sc->sa.pag, agbno, *aglenp);