All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH] xfs_repair: Search for conflicts in inode_tree_ptrs[] when processing uncertain inodes
@ 2022-05-23  4:34 Chandan Babu R
  2022-05-23  8:34 ` [PATCH V1.1] " Chandan Babu R
  0 siblings, 1 reply; 7+ messages in thread
From: Chandan Babu R @ 2022-05-23  4:34 UTC (permalink / raw)
  To: linux-xfs; +Cc: Chandan Babu R, sandeen

When processing an uncertain inode chunk record, if we lose 2 blocks worth of
inodes or 25% of the chunk, xfs_repair decides to ignore the chunk. Otherwise,
xfs_repair adds a new chunk record to inode_tree_ptrs[agno], marking each
inode as either free or used. However, before adding the new chunk record,
xfs_repair has to check for the existance of a conflicting record.

The existing code incorrectly checks for the conflicting record in
inode_uncertain_tree_ptrs[agno]. This check will succeed since the inode chunk
record being processed was originally obtained from
inode_uncertain_tree_ptrs[agno].

This commit fixes the bug by changing xfs_repair to search
inode_uncertain_tree_ptrs[agno] instead.

Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
---
 repair/dino_chunks.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

diff --git a/repair/dino_chunks.c b/repair/dino_chunks.c
index 11b0eb5f..80c52a43 100644
--- a/repair/dino_chunks.c
+++ b/repair/dino_chunks.c
@@ -229,8 +229,7 @@ verify_inode_chunk(xfs_mount_t		*mp,
 		/*
 		 * ok, put the record into the tree, if no conflict.
 		 */
-		if (find_uncertain_inode_rec(agno,
-				XFS_AGB_TO_AGINO(mp, start_agbno)))
+		if (find_inode_rec(mp, agno, XFS_AGB_TO_AGINO(mp, start_agbno)))
 			return(0);
 
 		start_agino = XFS_AGB_TO_AGINO(mp, start_agbno);
-- 
2.35.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2022-05-27  6:12 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-05-23  4:34 [PATCH] xfs_repair: Search for conflicts in inode_tree_ptrs[] when processing uncertain inodes Chandan Babu R
2022-05-23  8:34 ` [PATCH V1.1] " Chandan Babu R
2022-05-23 20:28   ` Darrick J. Wong
2022-05-23 23:08     ` Dave Chinner
2022-05-26 12:04       ` Chandan Babu R
2022-05-26 16:57         ` Darrick J. Wong
2022-05-27  5:51           ` Chandan Babu R

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.