diff mbox series

[24/50] xfs_repair: stop tracking duplicate RT extents with rtgroups

Message ID 173352752311.126362.6980632236757578255.stgit@frogsfrogsfrogs (mailing list archive)
State Not Applicable, archived
Headers show
Series [01/50] libxfs: remove XFS_ILOCK_RT* | expand

Commit Message

Darrick J. Wong Dec. 7, 2024, 12:11 a.m. UTC
From: Christoph Hellwig <hch@lst.de>

Nothing ever looks them up, so don't bother with tracking them by
overloading the AG numbers.

Signed-off-by: Christoph Hellwig <hch@lst.de>
Reviewed-by: "Darrick J. Wong" <djwong@kernel.org>
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 repair/incore_ext.c |    5 ++---
 repair/phase4.c     |    8 ++++++--
 2 files changed, 8 insertions(+), 5 deletions(-)

Comments

Christoph Hellwig Dec. 10, 2024, 5:38 a.m. UTC | #1
On Fri, Dec 06, 2024 at 04:11:11PM -0800, Darrick J. Wong wrote:
> From: Christoph Hellwig <hch@lst.de>
> 
> Nothing ever looks them up, so don't bother with tracking them by
> overloading the AG numbers.

This should probably also get folded into the main rtgroup repair patch.
Darrick J. Wong Dec. 11, 2024, 9:32 p.m. UTC | #2
On Mon, Dec 09, 2024 at 09:38:59PM -0800, Christoph Hellwig wrote:
> On Fri, Dec 06, 2024 at 04:11:11PM -0800, Darrick J. Wong wrote:
> > From: Christoph Hellwig <hch@lst.de>
> > 
> > Nothing ever looks them up, so don't bother with tracking them by
> > overloading the AG numbers.
> 
> This should probably also get folded into the main rtgroup repair patch.

Done.

--D
diff mbox series

Patch

diff --git a/repair/incore_ext.c b/repair/incore_ext.c
index a31ef066ef356c..892f9d25588c11 100644
--- a/repair/incore_ext.c
+++ b/repair/incore_ext.c
@@ -725,7 +725,7 @@  static avl64ops_t avl64_extent_tree_ops = {
 void
 incore_ext_init(xfs_mount_t *mp)
 {
-	xfs_agnumber_t agcount = mp->m_sb.sb_agcount + mp->m_sb.sb_rgcount;
+	xfs_agnumber_t agcount = mp->m_sb.sb_agcount;
 	int i;
 
 	pthread_mutex_init(&rt_ext_tree_lock, NULL);
@@ -778,10 +778,9 @@  incore_ext_init(xfs_mount_t *mp)
 void
 incore_ext_teardown(xfs_mount_t *mp)
 {
-	xfs_agnumber_t agcount = mp->m_sb.sb_agcount + mp->m_sb.sb_rgcount;
 	xfs_agnumber_t i;
 
-	for (i = 0; i < agcount; i++)  {
+	for (i = 0; i < mp->m_sb.sb_agcount; i++)  {
 		btree_destroy(dup_extent_trees[i]);
 		free(extent_bno_ptrs[i]);
 		free(extent_bcnt_ptrs[i]);
diff --git a/repair/phase4.c b/repair/phase4.c
index 3a627d8aeea85a..f43f8ecd84e25b 100644
--- a/repair/phase4.c
+++ b/repair/phase4.c
@@ -322,8 +322,12 @@  _("free space (%u,%u-%u) only seen by one free space btree\n"),
 		case XR_E_FS_MAP:
 			break;
 		case XR_E_MULT:
-			add_dup_extent(agno + isrt ? mp->m_sb.sb_agcount : 0,
-					agbno, blen);
+			/*
+			 * Nothing is searching for duplicate RT extents, so
+			 * don't bother tracking them.
+			 */
+			if (!isrt)
+				add_dup_extent(agno, agbno, blen);
 			break;
 		case XR_E_BAD_STATE:
 		default: