Commit f9ed6deb authored by Darrick J. Wong's avatar Darrick J. Wong

xfs: repair the AGF

Regenerate the AGF from the rmap data.
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Reviewed-by: default avatarBrian Foster <bfoster@redhat.com>
parent 73971b17
This diff is collapsed.
......@@ -128,9 +128,12 @@ xrep_roll_ag_trans(
int error;
/* Keep the AG header buffers locked so we can keep going. */
xfs_trans_bhold(sc->tp, sc->sa.agi_bp);
xfs_trans_bhold(sc->tp, sc->sa.agf_bp);
xfs_trans_bhold(sc->tp, sc->sa.agfl_bp);
if (sc->sa.agi_bp)
xfs_trans_bhold(sc->tp, sc->sa.agi_bp);
if (sc->sa.agf_bp)
xfs_trans_bhold(sc->tp, sc->sa.agf_bp);
if (sc->sa.agfl_bp)
xfs_trans_bhold(sc->tp, sc->sa.agfl_bp);
/* Roll the transaction. */
error = xfs_trans_roll(&sc->tp);
......@@ -138,9 +141,12 @@ xrep_roll_ag_trans(
goto out_release;
/* Join AG headers to the new transaction. */
xfs_trans_bjoin(sc->tp, sc->sa.agi_bp);
xfs_trans_bjoin(sc->tp, sc->sa.agf_bp);
xfs_trans_bjoin(sc->tp, sc->sa.agfl_bp);
if (sc->sa.agi_bp)
xfs_trans_bjoin(sc->tp, sc->sa.agi_bp);
if (sc->sa.agf_bp)
xfs_trans_bjoin(sc->tp, sc->sa.agf_bp);
if (sc->sa.agfl_bp)
xfs_trans_bjoin(sc->tp, sc->sa.agfl_bp);
return 0;
......@@ -150,9 +156,12 @@ xrep_roll_ag_trans(
* buffers will be released during teardown on our way out
* of the kernel.
*/
xfs_trans_bhold_release(sc->tp, sc->sa.agi_bp);
xfs_trans_bhold_release(sc->tp, sc->sa.agf_bp);
xfs_trans_bhold_release(sc->tp, sc->sa.agfl_bp);
if (sc->sa.agi_bp)
xfs_trans_bhold_release(sc->tp, sc->sa.agi_bp);
if (sc->sa.agf_bp)
xfs_trans_bhold_release(sc->tp, sc->sa.agf_bp);
if (sc->sa.agfl_bp)
xfs_trans_bhold_release(sc->tp, sc->sa.agfl_bp);
return error;
}
......
......@@ -58,6 +58,7 @@ int xrep_ino_dqattach(struct xfs_scrub *sc);
int xrep_probe(struct xfs_scrub *sc);
int xrep_superblock(struct xfs_scrub *sc);
int xrep_agf(struct xfs_scrub *sc);
#else
......@@ -81,6 +82,7 @@ xrep_calc_ag_resblks(
#define xrep_probe xrep_notsupported
#define xrep_superblock xrep_notsupported
#define xrep_agf xrep_notsupported
#endif /* CONFIG_XFS_ONLINE_REPAIR */
......
......@@ -214,7 +214,7 @@ static const struct xchk_meta_ops meta_scrub_ops[] = {
.type = ST_PERAG,
.setup = xchk_setup_fs,
.scrub = xchk_agf,
.repair = xrep_notsupported,
.repair = xrep_agf,
},
[XFS_SCRUB_TYPE_AGFL]= { /* agfl */
.type = ST_PERAG,
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment