diff mbox

[31/29,v2] xfs_scrub: handle scrub-only kernels more helpfully

Message ID 8b77b774-5f60-2236-ab23-b591417e79a9@sandeen.net (mailing list archive)
State Accepted
Headers show

Commit Message

Eric Sandeen Feb. 1, 2018, 9:46 p.m. UTC
If xfs_scrub is run today against a 4.15 kernel, it fails with

EXPERIMENTAL xfs_scrub program in use! Use at your own risk!
Error: /home: Kernel metadata optimization facility is required.
Info: /home: Scrub aborted after phase 1.
/home: 2 errors found.

Be a bit kinder to the user and suggest a path forward.  By the
time we fail for missing preen or repair functionality, we do
know that scrub is available, so suggest it.

Further, rather than stating what is required, state what was not
found ... we're failing, so state what was missing, vs. what is
required - seems a bit more definitive.

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

V2: change verbiage to make it more better and not not not confusing.



--
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

Bill O'Donnell Feb. 1, 2018, 9:49 p.m. UTC | #1
On Thu, Feb 01, 2018 at 03:46:20PM -0600, Eric Sandeen wrote:
> 
> 
> If xfs_scrub is run today against a 4.15 kernel, it fails with
> 
> EXPERIMENTAL xfs_scrub program in use! Use at your own risk!
> Error: /home: Kernel metadata optimization facility is required.
> Info: /home: Scrub aborted after phase 1.
> /home: 2 errors found.
> 
> Be a bit kinder to the user and suggest a path forward.  By the
> time we fail for missing preen or repair functionality, we do
> know that scrub is available, so suggest it.
> 
> Further, rather than stating what is required, state what was not
> found ... we're failing, so state what was missing, vs. what is
> required - seems a bit more definitive.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

looks good.

Reviewed-by: Bill O'Donnell <billodo@redhat.com>

> ---
> 
> V2: change verbiage to make it more better and not not not confusing.
> 
> diff --git a/scrub/phase1.c b/scrub/phase1.c
> index 547767b..9128429 100644
> --- a/scrub/phase1.c
> +++ b/scrub/phase1.c
> @@ -175,7 +175,7 @@ _("Does not appear to be an XFS filesystem!"));
>  	    !xfs_can_scrub_attr(ctx) || !xfs_can_scrub_symlink(ctx) ||
>  	    !xfs_can_scrub_parent(ctx)) {
>  		str_error(ctx, ctx->mntpoint,
> -_("Kernel metadata scrubbing facility is required."));
> +_("Kernel metadata scrubbing facility is not available."));
>  		return false;
>  	}
>  
> @@ -183,10 +183,10 @@ _("Kernel metadata scrubbing facility is required."));
>  	if (ctx->mode != SCRUB_MODE_DRY_RUN && !xfs_can_repair(ctx)) {
>  		if (ctx->mode == SCRUB_MODE_PREEN)
>  			str_error(ctx, ctx->mntpoint,
> -_("Kernel metadata optimization facility is required."));
> +_("Kernel metadata optimization facility is not available.  Use -n to scrub."));
>  		else
>  			str_error(ctx, ctx->mntpoint,
> -_("Kernel metadata repair facility is required."));
> +_("Kernel metadata repair facility is not available.  Use -n to scrub."));
>  		return false;
>  	}
>  
> 
> 
> --
> 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
Darrick J. Wong Feb. 1, 2018, 10:17 p.m. UTC | #2
On Thu, Feb 01, 2018 at 03:46:20PM -0600, Eric Sandeen wrote:
> 
> 
> If xfs_scrub is run today against a 4.15 kernel, it fails with
> 
> EXPERIMENTAL xfs_scrub program in use! Use at your own risk!
> Error: /home: Kernel metadata optimization facility is required.
> Info: /home: Scrub aborted after phase 1.
> /home: 2 errors found.
> 
> Be a bit kinder to the user and suggest a path forward.  By the
> time we fail for missing preen or repair functionality, we do
> know that scrub is available, so suggest it.
> 
> Further, rather than stating what is required, state what was not
> found ... we're failing, so state what was missing, vs. what is
> required - seems a bit more definitive.
> 
> Signed-off-by: Eric Sandeen <sandeen@redhat.com>

Looks ok,
Reviewed-by: Darrick J. Wong <darrick.wong@oracle.com>

> ---
> 
> V2: change verbiage to make it more better and not not not confusing.
> 
> diff --git a/scrub/phase1.c b/scrub/phase1.c
> index 547767b..9128429 100644
> --- a/scrub/phase1.c
> +++ b/scrub/phase1.c
> @@ -175,7 +175,7 @@ _("Does not appear to be an XFS filesystem!"));
>  	    !xfs_can_scrub_attr(ctx) || !xfs_can_scrub_symlink(ctx) ||
>  	    !xfs_can_scrub_parent(ctx)) {
>  		str_error(ctx, ctx->mntpoint,
> -_("Kernel metadata scrubbing facility is required."));
> +_("Kernel metadata scrubbing facility is not available."));
>  		return false;
>  	}
>  
> @@ -183,10 +183,10 @@ _("Kernel metadata scrubbing facility is required."));
>  	if (ctx->mode != SCRUB_MODE_DRY_RUN && !xfs_can_repair(ctx)) {
>  		if (ctx->mode == SCRUB_MODE_PREEN)
>  			str_error(ctx, ctx->mntpoint,
> -_("Kernel metadata optimization facility is required."));
> +_("Kernel metadata optimization facility is not available.  Use -n to scrub."));
>  		else
>  			str_error(ctx, ctx->mntpoint,
> -_("Kernel metadata repair facility is required."));
> +_("Kernel metadata repair facility is not available.  Use -n to scrub."));
>  		return false;
>  	}
>  
> 
> 
> --
> 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/phase1.c b/scrub/phase1.c
index 547767b..9128429 100644
--- a/scrub/phase1.c
+++ b/scrub/phase1.c
@@ -175,7 +175,7 @@  _("Does not appear to be an XFS filesystem!"));
 	    !xfs_can_scrub_attr(ctx) || !xfs_can_scrub_symlink(ctx) ||
 	    !xfs_can_scrub_parent(ctx)) {
 		str_error(ctx, ctx->mntpoint,
-_("Kernel metadata scrubbing facility is required."));
+_("Kernel metadata scrubbing facility is not available."));
 		return false;
 	}
 
@@ -183,10 +183,10 @@  _("Kernel metadata scrubbing facility is required."));
 	if (ctx->mode != SCRUB_MODE_DRY_RUN && !xfs_can_repair(ctx)) {
 		if (ctx->mode == SCRUB_MODE_PREEN)
 			str_error(ctx, ctx->mntpoint,
-_("Kernel metadata optimization facility is required."));
+_("Kernel metadata optimization facility is not available.  Use -n to scrub."));
 		else
 			str_error(ctx, ctx->mntpoint,
-_("Kernel metadata repair facility is required."));
+_("Kernel metadata repair facility is not available.  Use -n to scrub."));
 		return false;
 	}