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( ...@@ -128,9 +128,12 @@ xrep_roll_ag_trans(
int error; int error;
/* Keep the AG header buffers locked so we can keep going. */ /* Keep the AG header buffers locked so we can keep going. */
xfs_trans_bhold(sc->tp, sc->sa.agi_bp); if (sc->sa.agi_bp)
xfs_trans_bhold(sc->tp, sc->sa.agf_bp); xfs_trans_bhold(sc->tp, sc->sa.agi_bp);
xfs_trans_bhold(sc->tp, sc->sa.agfl_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. */ /* Roll the transaction. */
error = xfs_trans_roll(&sc->tp); error = xfs_trans_roll(&sc->tp);
...@@ -138,9 +141,12 @@ xrep_roll_ag_trans( ...@@ -138,9 +141,12 @@ xrep_roll_ag_trans(
goto out_release; goto out_release;
/* Join AG headers to the new transaction. */ /* Join AG headers to the new transaction. */
xfs_trans_bjoin(sc->tp, sc->sa.agi_bp); if (sc->sa.agi_bp)
xfs_trans_bjoin(sc->tp, sc->sa.agf_bp); xfs_trans_bjoin(sc->tp, sc->sa.agi_bp);
xfs_trans_bjoin(sc->tp, sc->sa.agfl_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; return 0;
...@@ -150,9 +156,12 @@ xrep_roll_ag_trans( ...@@ -150,9 +156,12 @@ xrep_roll_ag_trans(
* buffers will be released during teardown on our way out * buffers will be released during teardown on our way out
* of the kernel. * of the kernel.
*/ */
xfs_trans_bhold_release(sc->tp, sc->sa.agi_bp); if (sc->sa.agi_bp)
xfs_trans_bhold_release(sc->tp, sc->sa.agf_bp); xfs_trans_bhold_release(sc->tp, sc->sa.agi_bp);
xfs_trans_bhold_release(sc->tp, sc->sa.agfl_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; return error;
} }
......
...@@ -58,6 +58,7 @@ int xrep_ino_dqattach(struct xfs_scrub *sc); ...@@ -58,6 +58,7 @@ int xrep_ino_dqattach(struct xfs_scrub *sc);
int xrep_probe(struct xfs_scrub *sc); int xrep_probe(struct xfs_scrub *sc);
int xrep_superblock(struct xfs_scrub *sc); int xrep_superblock(struct xfs_scrub *sc);
int xrep_agf(struct xfs_scrub *sc);
#else #else
...@@ -81,6 +82,7 @@ xrep_calc_ag_resblks( ...@@ -81,6 +82,7 @@ xrep_calc_ag_resblks(
#define xrep_probe xrep_notsupported #define xrep_probe xrep_notsupported
#define xrep_superblock xrep_notsupported #define xrep_superblock xrep_notsupported
#define xrep_agf xrep_notsupported
#endif /* CONFIG_XFS_ONLINE_REPAIR */ #endif /* CONFIG_XFS_ONLINE_REPAIR */
......
...@@ -214,7 +214,7 @@ static const struct xchk_meta_ops meta_scrub_ops[] = { ...@@ -214,7 +214,7 @@ static const struct xchk_meta_ops meta_scrub_ops[] = {
.type = ST_PERAG, .type = ST_PERAG,
.setup = xchk_setup_fs, .setup = xchk_setup_fs,
.scrub = xchk_agf, .scrub = xchk_agf,
.repair = xrep_notsupported, .repair = xrep_agf,
}, },
[XFS_SCRUB_TYPE_AGFL]= { /* agfl */ [XFS_SCRUB_TYPE_AGFL]= { /* agfl */
.type = ST_PERAG, .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