On Mon, Oct 26, 2020 at 04:33:50PM -0700, Darrick J. Wong wrote: > From: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > > Reset both inode btree block counters in the AGI when rebuilding the > metadata indexes. > > Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx> > --- Reviewed-by: Brian Foster <bfoster@xxxxxxxxxx> > repair/phase5.c | 5 +++++ > 1 file changed, 5 insertions(+) > > > diff --git a/repair/phase5.c b/repair/phase5.c > index 446f7ec0a1db..b97d23809f3c 100644 > --- a/repair/phase5.c > +++ b/repair/phase5.c > @@ -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); > } >