diff mbox series

[7/9] xfs_repair: regenerate inode btree block counters in AGI

Message ID 160375523066.880355.14411170857056218197.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfsprogs: add a inode btree blocks counts to the AGI header | expand

Commit Message

Darrick J. Wong Oct. 26, 2020, 11:33 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Reset both inode btree block counters in the AGI when rebuilding the
metadata indexes.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 repair/phase5.c |    5 +++++
 1 file changed, 5 insertions(+)

Comments

Brian Foster Oct. 28, 2020, 5:30 p.m. UTC | #1
On Mon, Oct 26, 2020 at 04:33:50PM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> 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>

>  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);
>  }
>
diff mbox series

Patch

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);
 }