]> www.infradead.org Git - users/hch/xfs.git/commitdiff
xfs: check the metadata directory inumber in superblocks
authorDarrick J. Wong <djwong@kernel.org>
Wed, 7 Aug 2024 22:54:24 +0000 (15:54 -0700)
committerChristoph Hellwig <hch@lst.de>
Sun, 22 Sep 2024 06:07:21 +0000 (08:07 +0200)
When metadata directories are enabled, make sure that the secondary
superblocks point to the metadata directory.  This isn't strictly
required because the secondaries are only used to recover damaged
filesystems.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
fs/xfs/scrub/agheader.c

index f8e5b67128d25a190a4b49a7bca355defe603f74..cad997f38a424cf59020992b4edfdadb49f3498c 100644 (file)
@@ -144,6 +144,11 @@ xchk_superblock(
        if (sb->sb_rootino != cpu_to_be64(mp->m_sb.sb_rootino))
                xchk_block_set_preen(sc, bp);
 
+       if (xfs_has_metadir(sc->mp)) {
+               if (sb->sb_metadirino != cpu_to_be64(mp->m_sb.sb_metadirino))
+                       xchk_block_set_preen(sc, bp);
+       }
+
        if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino))
                xchk_block_set_preen(sc, bp);