]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: Search for conflicts in inode_tree_ptrs[] when processing uncertain inodes
authorChandan Babu R <chandan.babu@oracle.com>
Thu, 14 Jul 2022 01:58:27 +0000 (20:58 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Thu, 14 Jul 2022 01:58:27 +0000 (20:58 -0500)
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_tree_ptrs[agno] for conflicts.

Signed-off-by: Chandan Babu R <chandan.babu@oracle.com>
Reviewed-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/dino_chunks.c

index 11b0eb5f219f69eec380160e41cd818f8ae39b99..80c52a439dc9a4d620628596713e785c048cbfe4 100644 (file)
@@ -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);