]> www.infradead.org Git - users/hch/xfsprogs.git/commitdiff
xfs_repair: preserve the metadirino field when zeroing supers
authorDarrick J. Wong <djwong@kernel.org>
Wed, 3 Jul 2024 21:21:52 +0000 (14:21 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jul 2024 00:13:17 +0000 (17:13 -0700)
The metadata directory root inumber is now the last field in the
superblock, so extend the zeroing code to know about that.

Signed-off-by: Darrick J. Wong <djwong@kernel.org>
repair/agheader.c

index 3930a0ac0919b419f1a490ff3885ba154d16d9d7..5d4ca26cfb615535a2f041d4d0fb16db51f4bc40 100644 (file)
@@ -357,7 +357,10 @@ secondary_sb_whack(
         *
         * size is the size of data which is valid for this sb.
         */
-       if (xfs_sb_version_hasmetauuid(sb))
+       if (xfs_sb_version_hasmetadir(sb))
+               size = offsetof(struct xfs_dsb, sb_metadirino)
+                       + sizeof(sb->sb_metadirino);
+       else if (xfs_sb_version_hasmetauuid(sb))
                size = offsetof(struct xfs_dsb, sb_meta_uuid)
                        + sizeof(sb->sb_meta_uuid);
        else if (xfs_sb_version_hascrc(sb))