]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_repair: regenerate inode btree block counters in AGI
authorDarrick J. Wong <darrick.wong@oracle.com>
Fri, 20 Nov 2020 22:03:27 +0000 (17:03 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Fri, 20 Nov 2020 22:03:27 +0000 (17:03 -0500)
Reset both inode btree block counters in the AGI when rebuilding the
metadata indexes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: Brian Foster <bfoster@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
repair/phase5.c

index 446f7ec0a1db5d986e971b7481c4d2a929f656f3..b97d23809f3c47e8e53b83ce04f17295f5f50471 100644 (file)
@@ -172,6 +172,11 @@ build_agi(
                                cpu_to_be32(btr_fino->newbt.afake.af_levels);
        }
 
+       if (xfs_sb_version_hasinobtcounts(&mp->m_sb)) {
+               agi->agi_iblocks = cpu_to_be32(btr_ino->newbt.afake.af_blocks);
+               agi->agi_fblocks = cpu_to_be32(btr_fino->newbt.afake.af_blocks);
+       }
+
        libxfs_buf_mark_dirty(agi_buf);
        libxfs_buf_relse(agi_buf);
 }