aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2019-11-01 17:55:06 -0400
committerEric Sandeen <sandeen@sandeen.net>2019-11-01 17:55:06 -0400
commite458f3f13e678e48549cf03bef92a13b88d7f17f (patch)
treef915946e969ed58ad4be22718e924ae729d3c063
parentabc2e70db965430c8d83d8b76070cc75066dfe9f (diff)
downloadxfsprogs-dev-e458f3f13e678e48549cf03bef92a13b88d7f17f.tar.gz
xfs_scrub: promote some of the str_info to str_error calls
Now that str_error is only for runtime errors, we can promote a few of the str_info calls that report runtime errors to str_error. Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com> Reviewed-by: Eric Sandeen <sandeen@redhat.com> Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
-rw-r--r--scrub/phase1.c10
-rw-r--r--scrub/scrub.c11
2 files changed, 10 insertions, 11 deletions
diff --git a/scrub/phase1.c b/scrub/phase1.c
index d040c4a89b..0ae368ff8e 100644
--- a/scrub/phase1.c
+++ b/scrub/phase1.c
@@ -88,7 +88,7 @@ xfs_setup_fs(
O_RDONLY | O_NOATIME | O_DIRECTORY);
if (error) {
if (error == EPERM)
- str_info(ctx, ctx->mntpoint,
+ str_error(ctx, ctx->mntpoint,
_("Must be root to run scrub."));
else if (error == ENOTTY)
str_error(ctx, ctx->mntpoint,
@@ -143,26 +143,26 @@ _("Not an XFS filesystem."));
!xfs_can_scrub_bmap(ctx) || !xfs_can_scrub_dir(ctx) ||
!xfs_can_scrub_attr(ctx) || !xfs_can_scrub_symlink(ctx) ||
!xfs_can_scrub_parent(ctx)) {
- str_info(ctx, ctx->mntpoint,
+ str_error(ctx, ctx->mntpoint,
_("Kernel metadata scrubbing facility is not available."));
return false;
}
/* Do we need kernel-assisted metadata repair? */
if (ctx->mode != SCRUB_MODE_DRY_RUN && !xfs_can_repair(ctx)) {
- str_info(ctx, ctx->mntpoint,
+ str_error(ctx, ctx->mntpoint,
_("Kernel metadata repair facility is not available. Use -n to scrub."));
return false;
}
/* Did we find the log and rt devices, if they're present? */
if (ctx->mnt.fsgeom.logstart == 0 && ctx->fsinfo.fs_log == NULL) {
- str_info(ctx, ctx->mntpoint,
+ str_error(ctx, ctx->mntpoint,
_("Unable to find log device path."));
return false;
}
if (ctx->mnt.fsgeom.rtblocks && ctx->fsinfo.fs_rt == NULL) {
- str_info(ctx, ctx->mntpoint,
+ str_error(ctx, ctx->mntpoint,
_("Unable to find realtime device path."));
return false;
}
diff --git a/scrub/scrub.c b/scrub/scrub.c
index 75a64efa9e..718f09b8cd 100644
--- a/scrub/scrub.c
+++ b/scrub/scrub.c
@@ -141,7 +141,7 @@ retry:
return CHECK_DONE;
case ESHUTDOWN:
/* FS already crashed, give up. */
- str_info(ctx, buf,
+ str_error(ctx, buf,
_("Filesystem is shut down, aborting."));
return CHECK_ABORT;
case EIO:
@@ -157,8 +157,7 @@ _("Filesystem is shut down, aborting."));
* The first two should never escape the kernel,
* and the other two should be reported via sm_flags.
*/
- str_info(ctx, buf,
-_("Kernel bug! errno=%d"), code);
+ str_liberror(ctx, code, _("Kernel bug"));
/* fall through */
default:
/* Operational error. */
@@ -702,7 +701,7 @@ _("Filesystem is busy, deferring repair."));
return CHECK_RETRY;
case ESHUTDOWN:
/* Filesystem is already shut down, abort. */
- str_info(ctx, buf,
+ str_error(ctx, buf,
_("Filesystem is shut down, aborting."));
return CHECK_ABORT;
case ENOTTY:
@@ -733,9 +732,9 @@ _("Don't know how to fix; offline repair required."));
case EROFS:
/* Read-only filesystem, can't fix. */
if (verbose || debug || needs_repair(&oldm))
- str_info(ctx, buf,
+ str_error(ctx, buf,
_("Read-only filesystem; cannot make changes."));
- return CHECK_DONE;
+ return CHECK_ABORT;
case ENOENT:
/* Metadata not present, just skip it. */
return CHECK_DONE;