diff mbox

[06/10] xfs_scrub: don't error out if an optimize-only repair isn't supported

Message ID 153006770873.20121.6125776702823601560.stgit@magnolia (mailing list archive)
State Accepted
Headers show

Commit Message

Darrick J. Wong June 27, 2018, 2:48 a.m. UTC
From: Darrick J. Wong <darrick.wong@oracle.com>

If the kernel told us a metadata object could be optimized, we ask it to
do the optimization and it spits back that it doesn't support
optimizing, don't record this as an error since the fs is still
consistent.

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



--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

Eric Sandeen July 26, 2018, 1:09 a.m. UTC | #1
On 6/26/18 7:48 PM, Darrick J. Wong wrote:
> From: Darrick J. Wong <darrick.wong@oracle.com>
> 
> If the kernel told us a metadata object could be optimized, we ask it to
> do the optimization and it spits back that it doesn't support
> optimizing, don't record this as an error since the fs is still
> consistent.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

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

> ---
>  scrub/scrub.c |    7 ++++---
>  1 file changed, 4 insertions(+), 3 deletions(-)
> 
> 
> diff --git a/scrub/scrub.c b/scrub/scrub.c
> index c893f2c9..fe4e880f 100644
> --- a/scrub/scrub.c
> +++ b/scrub/scrub.c
> @@ -782,10 +782,11 @@ _("Filesystem is shut down, aborting."));
>  		case ENOTTY:
>  		case EOPNOTSUPP:
>  			/*
> -			 * If we forced repairs, don't complain if kernel
> -			 * doesn't know how to fix.
> +			 * If we forced repairs or this is a preen, don't
> +			 * error out if the kernel doesn't know how to fix.
>  			 */
> -			if (debug_tweak_on("XFS_SCRUB_FORCE_REPAIR"))
> +			if (is_unoptimized(&oldm) ||
> +			    debug_tweak_on("XFS_SCRUB_FORCE_REPAIR"))
>  				return CHECK_DONE;
>  			/* fall through */
>  		case EINVAL:
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-xfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/scrub/scrub.c b/scrub/scrub.c
index c893f2c9..fe4e880f 100644
--- a/scrub/scrub.c
+++ b/scrub/scrub.c
@@ -782,10 +782,11 @@  _("Filesystem is shut down, aborting."));
 		case ENOTTY:
 		case EOPNOTSUPP:
 			/*
-			 * If we forced repairs, don't complain if kernel
-			 * doesn't know how to fix.
+			 * If we forced repairs or this is a preen, don't
+			 * error out if the kernel doesn't know how to fix.
 			 */
-			if (debug_tweak_on("XFS_SCRUB_FORCE_REPAIR"))
+			if (is_unoptimized(&oldm) ||
+			    debug_tweak_on("XFS_SCRUB_FORCE_REPAIR"))
 				return CHECK_DONE;
 			/* fall through */
 		case EINVAL: