xfs
[Top] [All Lists]

[PATCH 21/29] xfs_repair: factor rrmapino into superblock size calculati

To: david@xxxxxxxxxxxxx, darrick.wong@xxxxxxxxxx
Subject: [PATCH 21/29] xfs_repair: factor rrmapino into superblock size calculations
From: "Darrick J. Wong" <darrick.wong@xxxxxxxxxx>
Date: Thu, 25 Aug 2016 17:00:50 -0700
Cc: linux-xfs@xxxxxxxxxxxxxxx, xfs@xxxxxxxxxxx
Delivered-to: xfs@xxxxxxxxxxx
In-reply-to: <147216950911.7022.438115723996286926.stgit@xxxxxxxxxxxxxxxx>
References: <147216950911.7022.438115723996286926.stgit@xxxxxxxxxxxxxxxx>
User-agent: StGit/0.17.1-dirty
Now that we've extended the superblock with a field for the rtrmapbt
inode, we must adjust the superblock size calculation to include it.
This way, repair won't complain about the non-zero contents of
rrmapino.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
 repair/agheader.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)


diff --git a/repair/agheader.c b/repair/agheader.c
index cce376f..8eb7f80 100644
--- a/repair/agheader.c
+++ b/repair/agheader.c
@@ -270,7 +270,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_hasrmapbt(sb) && mp->m_sb.sb_rblocks > 0)
+               size = offsetof(struct xfs_sb, sb_rrmapino)
+                       + sizeof(sb->sb_rrmapino);
+       else if (xfs_sb_version_hasmetauuid(sb))
                size = offsetof(xfs_sb_t, sb_meta_uuid)
                        + sizeof(sb->sb_meta_uuid);
        else if (xfs_sb_version_hascrc(sb))

<Prev in Thread] Current Thread [Next in Thread>