diff mbox series

[04/11] xfs_scrub: improve reporting of file metadata media errors

Message ID 156944739208.300131.5955900694911585741.stgit@magnolia (mailing list archive)
State Accepted
Headers show
Series xfs_scrub: fix IO error reporting | expand

Commit Message

Darrick J. Wong Sept. 25, 2019, 9:36 p.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

Report media errors that map to data and attr fork extent maps.

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

Comments

Eric Sandeen Oct. 21, 2019, 4:53 p.m. UTC | #1
On 9/25/19 4:36 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> Report media errors that map to data and attr fork extent maps.

Ok so I think the last patch removed reporting on files but this adds it
back...

Reviewed-by: Eric Sandeen <sandeen@redhat.com>


> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
> ---
>  scrub/phase6.c |   11 +++++++++++
>  1 file changed, 11 insertions(+)
> 
> 
> diff --git a/scrub/phase6.c b/scrub/phase6.c
> index 310ab36c..1013ba6d 100644
> --- a/scrub/phase6.c
> +++ b/scrub/phase6.c
> @@ -385,6 +385,17 @@ xfs_check_rmap_error_report(
>  		str_error(ctx, buf, _("media error in %s."), type);
>  	}
>  
> +	/* Report extent maps */
> +	if (map->fmr_flags & FMR_OF_EXTENT_MAP) {
> +		bool		attr = (map->fmr_flags & FMR_OF_ATTR_FORK);
> +
> +		scrub_render_ino_suffix(ctx, buf, DESCR_BUFSZ,
> +				map->fmr_owner, 0, " %s",
> +				attr ? _("extended attribute") :
> +				       _("file data"));
> +		str_error(ctx, buf, _("media error in extent map"));
> +	}
> +
>  	/*
>  	 * XXX: If we had a getparent() call we could report IO errors
>  	 * efficiently.  Until then, we'll have to scan the dir tree
>
diff mbox series

Patch

diff --git a/scrub/phase6.c b/scrub/phase6.c
index 310ab36c..1013ba6d 100644
--- a/scrub/phase6.c
+++ b/scrub/phase6.c
@@ -385,6 +385,17 @@  xfs_check_rmap_error_report(
 		str_error(ctx, buf, _("media error in %s."), type);
 	}
 
+	/* Report extent maps */
+	if (map->fmr_flags & FMR_OF_EXTENT_MAP) {
+		bool		attr = (map->fmr_flags & FMR_OF_ATTR_FORK);
+
+		scrub_render_ino_suffix(ctx, buf, DESCR_BUFSZ,
+				map->fmr_owner, 0, " %s",
+				attr ? _("extended attribute") :
+				       _("file data"));
+		str_error(ctx, buf, _("media error in extent map"));
+	}
+
 	/*
 	 * XXX: If we had a getparent() call we could report IO errors
 	 * efficiently.  Until then, we'll have to scan the dir tree