Skip to content

Commit dcde94b

Browse files
author
Darrick J. Wong
committed
xfs: check the metadata directory inumber in superblocks
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, and the metadir root inumber is fixed. Signed-off-by: Darrick J. Wong <[email protected]> Reviewed-by: Christoph Hellwig <[email protected]>
1 parent 3d2c341 commit dcde94b

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

fs/xfs/scrub/agheader.c

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -144,6 +144,11 @@ xchk_superblock(
144144
if (sb->sb_rootino != cpu_to_be64(mp->m_sb.sb_rootino))
145145
xchk_block_set_preen(sc, bp);
146146

147+
if (xfs_has_metadir(sc->mp)) {
148+
if (sb->sb_metadirino != cpu_to_be64(mp->m_sb.sb_metadirino))
149+
xchk_block_set_preen(sc, bp);
150+
}
151+
147152
if (sb->sb_rbmino != cpu_to_be64(mp->m_sb.sb_rbmino))
148153
xchk_block_set_preen(sc, bp);
149154

0 commit comments

Comments
 (0)