diff mbox series

[16/38] xfs_repair: preserve the metadirino field when zeroing supers

Message ID 172860654222.4183231.9045150758158670303.stgit@frogsfrogsfrogs (mailing list archive)
State Not Applicable, archived
Headers show
Series [01/38] libfrog: report metadata directories in the geometry report | expand

Commit Message

Darrick J. Wong Oct. 11, 2024, 1:18 a.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

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 |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/repair/agheader.c b/repair/agheader.c
index 3930a0ac0919b4..5d4ca26cfb6155 100644
--- a/repair/agheader.c
+++ b/repair/agheader.c
@@ -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))