Skip to content

Commit 939c9de

Browse files
author
Chandan Babu R
committed
Merge tag 'repair-agfl-fixes-6.6_2023-08-10' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux into xfs-6.6-mergeA
xfs: fixes to the AGFL repair code This series contains a couple of bug fixes to the AGFL repair code that came up during QA. Signed-off-by: Darrick J. Wong <djwong@kernel.org> Signed-off-by: Chandan Babu R <chandan.babu@oracle.com> * tag 'repair-agfl-fixes-6.6_2023-08-10' of https://git.kernel.org/pub/scm/linux/kernel/git/djwong/xfs-linux: xfs: fix agf_fllast when repairing an empty AGFL xfs: clear pagf_agflreset when repairing the AGFL
2 parents 5221002 + a634c0a commit 939c9de

File tree

1 file changed

+8
-2
lines changed

1 file changed

+8
-2
lines changed

fs/xfs/scrub/agheader_repair.c

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -620,11 +620,17 @@ xrep_agfl_update_agf(
620620
xfs_force_summary_recalc(sc->mp);
621621

622622
/* Update the AGF counters. */
623-
if (xfs_perag_initialised_agf(sc->sa.pag))
623+
if (xfs_perag_initialised_agf(sc->sa.pag)) {
624624
sc->sa.pag->pagf_flcount = flcount;
625+
clear_bit(XFS_AGSTATE_AGFL_NEEDS_RESET,
626+
&sc->sa.pag->pag_opstate);
627+
}
625628
agf->agf_flfirst = cpu_to_be32(0);
626629
agf->agf_flcount = cpu_to_be32(flcount);
627-
agf->agf_fllast = cpu_to_be32(flcount - 1);
630+
if (flcount)
631+
agf->agf_fllast = cpu_to_be32(flcount - 1);
632+
else
633+
agf->agf_fllast = cpu_to_be32(xfs_agfl_size(sc->mp) - 1);
628634

629635
xfs_alloc_log_agf(sc->tp, agf_bp,
630636
XFS_AGF_FLFIRST | XFS_AGF_FLLAST | XFS_AGF_FLCOUNT);

0 commit comments

Comments
 (0)