[2/2] xfs: always rescan allegedly healthy per-ag metadata after repair
diff mbox series

Message ID 157063978533.2913625.15756257326965494318.stgit@magnolia
State New
Headers show
Series
  • xfs: health evaluations for repair
Related show

Commit Message

Darrick J. Wong Oct. 9, 2019, 4:49 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

After an online repair function runs for a per-AG metadata structure,
sc->sick_mask is supposed to reflect the per-AG metadata that the repair
function fixed.  Our next move is to re-check the metadata to assess
the completeness of our repair, so we don't want the rebuilt structure
to be excluded from the rescan just because the health system previously
logged a problem with the data structure.

Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
---
 fs/xfs/scrub/health.c |   10 ++++++++++
 1 file changed, 10 insertions(+)

Comments

Brian Foster Oct. 23, 2019, 11:09 a.m. UTC | #1
On Wed, Oct 09, 2019 at 09:49:45AM -0700, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> After an online repair function runs for a per-AG metadata structure,
> sc->sick_mask is supposed to reflect the per-AG metadata that the repair
> function fixed.  Our next move is to re-check the metadata to assess
> the completeness of our repair, so we don't want the rebuilt structure
> to be excluded from the rescan just because the health system previously
> logged a problem with the data structure.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---

Reviewed-by: Brian Foster <bfoster@redhat.com>

>  fs/xfs/scrub/health.c |   10 ++++++++++
>  1 file changed, 10 insertions(+)
> 
> 
> diff --git a/fs/xfs/scrub/health.c b/fs/xfs/scrub/health.c
> index b2f602811e9d..4865b2180e22 100644
> --- a/fs/xfs/scrub/health.c
> +++ b/fs/xfs/scrub/health.c
> @@ -220,6 +220,16 @@ xchk_ag_btree_healthy_enough(
>  		return true;
>  	}
>  
> +	/*
> +	 * If we just repaired some AG metadata, sc->sick_mask will reflect all
> +	 * the per-AG metadata types that were repaired.  Exclude these from
> +	 * the filesystem health query because we have not yet updated the
> +	 * health status and we want everything to be scanned.
> +	 */
> +	if ((sc->flags & XREP_ALREADY_FIXED) &&
> +	    type_to_health_flag[sc->sm->sm_type].group == XHG_AG)
> +		mask &= ~sc->sick_mask;
> +
>  	if (xfs_ag_has_sickness(pag, mask)) {
>  		sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XFAIL;
>  		return false;
>

Patch
diff mbox series

diff --git a/fs/xfs/scrub/health.c b/fs/xfs/scrub/health.c
index b2f602811e9d..4865b2180e22 100644
--- a/fs/xfs/scrub/health.c
+++ b/fs/xfs/scrub/health.c
@@ -220,6 +220,16 @@  xchk_ag_btree_healthy_enough(
 		return true;
 	}
 
+	/*
+	 * If we just repaired some AG metadata, sc->sick_mask will reflect all
+	 * the per-AG metadata types that were repaired.  Exclude these from
+	 * the filesystem health query because we have not yet updated the
+	 * health status and we want everything to be scanned.
+	 */
+	if ((sc->flags & XREP_ALREADY_FIXED) &&
+	    type_to_health_flag[sc->sm->sm_type].group == XHG_AG)
+		mask &= ~sc->sick_mask;
+
 	if (xfs_ag_has_sickness(pag, mask)) {
 		sc->sm->sm_flags |= XFS_SCRUB_OFLAG_XFAIL;
 		return false;