diff options
author | Darrick J. Wong <djwong@kernel.org> | 2024-11-03 20:19:00 -0800 |
---|---|---|
committer | Darrick J. Wong <djwong@kernel.org> | 2024-11-05 13:38:34 -0800 |
commit | dcde94bdeeb94d04b3d8156345c79b9cdfcc4a0d (patch) | |
tree | a0b4e480afce53bb99b2a6d0ae1f0b15832dce78 | |
parent | 3d2c34111144a9fd3207ab914a7cd807cbe6a613 (diff) | |
download | linux-dcde94bdeeb94d04b3d8156345c79b9cdfcc4a0d.tar.gz linux-dcde94bdeeb94d04b3d8156345c79b9cdfcc4a0d.tar.bz2 linux-dcde94bdeeb94d04b3d8156345c79b9cdfcc4a0d.zip |
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 <djwong@kernel.org>
Reviewed-by: Christoph Hellwig <hch@lst.de>
-rw-r--r-- | fs/xfs/scrub/agheader.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/fs/xfs/scrub/agheader.c b/fs/xfs/scrub/agheader.c index f8e5b67128d2..cad997f38a42 100644 --- a/fs/xfs/scrub/agheader.c +++ b/fs/xfs/scrub/agheader.c @@ -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); |