]> git.apps.os.sepia.ceph.com Git - xfsprogs-dev.git/commit
xfs_repair: synthesize incore inode tree records when required
authorDarrick J. Wong <djwong@kernel.org>
Thu, 14 Nov 2024 23:53:24 +0000 (15:53 -0800)
committerDarrick J. Wong <djwong@kernel.org>
Thu, 21 Nov 2024 00:03:44 +0000 (16:03 -0800)
commit09f319213924f4ed144b23368e33a7ff7ef5ddd2
tree078eeaa20ed9dedb2fe9d308a812d4e32531d529
parent2c054ce65a40bc7100ee63a0c944f2c801bff003
xfs_repair: synthesize incore inode tree records when required

On a filesystem with 64k fsblock size, xfs/093 fails with the following:

Phase 3 - for each AG...
        - scan and clear agi unlinked lists...
found inodes not in the inode allocation tree
found inodes not in the inode allocation tree
        - process known inodes and perform inode discovery...
        - agno = 0
xfs_repair: dino_chunks.c:1166: process_aginodes: Assertion `num_inos == igeo->ialloc_inos' failed.
./common/xfs: line 392: 361225 Aborted                 (core dumped) $XFS_REPAIR_PROG $SCRATCH_OPTIONS $* $SCRATCH_DEV

In this situation, the inode size is 512b, which means that two inobt
records map to a single fs block.  However, the inobt walk didn't find
the second record, so it didn't create a second incore ino_tree_node_t
object.  The assertion trips, and we fail to repair the filesystem.

To fix this, synthesize incore inode records when we know that they must
exist.  Mark the inodes as in use so that they will not be purged from
parent directories or moved to lost+found if the directory tree is also
compromised.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
repair/dino_chunks.c