aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDarrick J. Wong <darrick.wong@oracle.com>2018-02-12 15:47:52 -0600
committerEric Sandeen <sandeen@redhat.com>2018-02-12 15:47:52 -0600
commit82377bde20e9d52b167d8517d68423ccf47a9ebc (patch)
tree9cda5b5810ca978059c22657ce324294755ff7fd
parent1df93c8d953fd736cbc6f4b62399cd5a1ab1fcc0 (diff)
downloadxfsprogs-dev-82377bde20e9d52b167d8517d68423ccf47a9ebc.tar.gz
xfs_scrub: reclassify runtime errors
If the program encounters runtime errors, these should be noted as information. Because these errors abort the execution flow (which is counted as a runtime error), we need only call str_info to log the event. 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/fscounters.c4
-rw-r--r--scrub/inodes.c4
-rw-r--r--scrub/phase1.c8
-rw-r--r--scrub/phase2.c6
-rw-r--r--scrub/phase3.c2
-rw-r--r--scrub/phase6.c2
-rw-r--r--scrub/read_verify.c2
-rw-r--r--scrub/scrub.c8
-rw-r--r--scrub/spacemap.c8
-rw-r--r--scrub/vfs.c6
10 files changed, 25 insertions, 25 deletions
diff --git a/scrub/fscounters.c b/scrub/fscounters.c
index 4294bf31b3..ecdf4c6126 100644
--- a/scrub/fscounters.c
+++ b/scrub/fscounters.c
@@ -139,14 +139,14 @@ xfs_count_all_inodes(
scrub_nproc_workqueue(ctx));
if (ret) {
moveon = false;
- str_error(ctx, ctx->mntpoint, _("Could not create workqueue."));
+ str_info(ctx, ctx->mntpoint, _("Could not create workqueue."));
goto out_free;
}
for (agno = 0; agno < ctx->geo.agcount; agno++) {
ret = workqueue_add(&wq, xfs_count_ag_inodes, agno, ci);
if (ret) {
moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue AG %u icount work."), agno);
break;
}
diff --git a/scrub/inodes.c b/scrub/inodes.c
index 23ec704443..57b773ee76 100644
--- a/scrub/inodes.c
+++ b/scrub/inodes.c
@@ -266,7 +266,7 @@ xfs_scan_all_inodes(
ret = workqueue_create(&wq, (struct xfs_mount *)ctx,
scrub_nproc_workqueue(ctx));
if (ret) {
- str_error(ctx, ctx->mntpoint, _("Could not create workqueue."));
+ str_info(ctx, ctx->mntpoint, _("Could not create workqueue."));
return false;
}
@@ -274,7 +274,7 @@ xfs_scan_all_inodes(
ret = workqueue_add(&wq, xfs_scan_ag_inodes, agno, &si);
if (ret) {
si.moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue AG %u bulkstat work."), agno);
break;
}
diff --git a/scrub/phase1.c b/scrub/phase1.c
index 82c80223b3..6cd544233c 100644
--- a/scrub/phase1.c
+++ b/scrub/phase1.c
@@ -134,7 +134,7 @@ _("Must be root to run scrub."));
}
if (!platform_test_xfs_fd(ctx->mnt_fd)) {
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Does not appear to be an XFS filesystem!"));
return false;
}
@@ -191,7 +191,7 @@ _("Kernel metadata repair facility is not available. Use -n to scrub."));
errno = 0;
fsp = fs_table_lookup(ctx->mntpoint, FS_MOUNT_POINT);
if (!fsp) {
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Unable to find XFS information."));
return false;
}
@@ -199,12 +199,12 @@ _("Unable to find XFS information."));
/* Did we find the log and rt devices, if they're present? */
if (ctx->geo.logstart == 0 && ctx->fsinfo.fs_log == NULL) {
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Unable to find log device path."));
return false;
}
if (ctx->geo.rtblocks && ctx->fsinfo.fs_rt == NULL) {
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Unable to find realtime device path."));
return false;
}
diff --git a/scrub/phase2.c b/scrub/phase2.c
index 32e2752efd..edf66df6a7 100644
--- a/scrub/phase2.c
+++ b/scrub/phase2.c
@@ -94,7 +94,7 @@ xfs_scan_metadata(
ret = workqueue_create(&wq, (struct xfs_mount *)ctx,
scrub_nproc_workqueue(ctx));
if (ret) {
- str_error(ctx, ctx->mntpoint, _("Could not create workqueue."));
+ str_info(ctx, ctx->mntpoint, _("Could not create workqueue."));
return false;
}
@@ -111,7 +111,7 @@ xfs_scan_metadata(
ret = workqueue_add(&wq, xfs_scan_ag_metadata, agno, &moveon);
if (ret) {
moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue AG %u scrub work."), agno);
goto out;
}
@@ -123,7 +123,7 @@ _("Could not queue AG %u scrub work."), agno);
ret = workqueue_add(&wq, xfs_scan_fs_metadata, 0, &moveon);
if (ret) {
moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue filesystem scrub work."));
goto out;
}
diff --git a/scrub/phase3.c b/scrub/phase3.c
index f4117b013a..a0ee5d9e3f 100644
--- a/scrub/phase3.c
+++ b/scrub/phase3.c
@@ -137,7 +137,7 @@ xfs_scan_inodes(
ictx.moveon = true;
ictx.icount = ptcounter_init(scrub_nproc(ctx));
if (!ictx.icount) {
- str_error(ctx, ctx->mntpoint, _("Could not create counter."));
+ str_info(ctx, ctx->mntpoint, _("Could not create counter."));
return false;
}
diff --git a/scrub/phase6.c b/scrub/phase6.c
index 9795bf3b0e..f9859509e6 100644
--- a/scrub/phase6.c
+++ b/scrub/phase6.c
@@ -485,7 +485,7 @@ xfs_scan_blocks(
xfs_check_rmap_ioerr, disk_heads(ctx->datadev));
if (!ve.readverify) {
moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not create media verifier."));
goto out_rbad;
}
diff --git a/scrub/read_verify.c b/scrub/read_verify.c
index e816688ba4..ae2e85fc86 100644
--- a/scrub/read_verify.c
+++ b/scrub/read_verify.c
@@ -187,7 +187,7 @@ read_verify_queue(
ret = workqueue_add(&rvp->wq, read_verify, 0, tmp);
if (ret) {
- str_error(rvp->ctx, rvp->ctx->mntpoint,
+ str_info(rvp->ctx, rvp->ctx->mntpoint,
_("Could not queue read-verify work."));
free(tmp);
return false;
diff --git a/scrub/scrub.c b/scrub/scrub.c
index bc0e2f0502..ff5357c651 100644
--- a/scrub/scrub.c
+++ b/scrub/scrub.c
@@ -219,7 +219,7 @@ retry:
return CHECK_DONE;
case ESHUTDOWN:
/* FS already crashed, give up. */
- str_error(ctx, buf,
+ str_info(ctx, buf,
_("Filesystem is shut down, aborting."));
return CHECK_ABORT;
case EIO:
@@ -235,7 +235,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_error(ctx, buf,
+ str_info(ctx, buf,
_("Kernel bug! errno=%d"), code);
/* fall through */
default:
@@ -568,7 +568,7 @@ __xfs_scrub_test(
if (debug_tweak_on("XFS_SCRUB_NO_KERNEL"))
return false;
if (debug_tweak_on("XFS_SCRUB_FORCE_REPAIR") && !injected) {
- str_error(ctx, "XFS_SCRUB_FORCE_REPAIR", "Not supported.");
+ str_info(ctx, "XFS_SCRUB_FORCE_REPAIR", "Not supported.");
return false;
}
@@ -726,7 +726,7 @@ _("Filesystem is busy, deferring repair."));
return CHECK_RETRY;
case ESHUTDOWN:
/* Filesystem is already shut down, abort. */
- str_error(ctx, buf,
+ str_info(ctx, buf,
_("Filesystem is shut down, aborting."));
return CHECK_ABORT;
case ENOTTY:
diff --git a/scrub/spacemap.c b/scrub/spacemap.c
index 2dc6e2b884..f631913002 100644
--- a/scrub/spacemap.c
+++ b/scrub/spacemap.c
@@ -217,7 +217,7 @@ xfs_scan_all_spacemaps(
ret = workqueue_create(&wq, (struct xfs_mount *)ctx,
scrub_nproc_workqueue(ctx));
if (ret) {
- str_error(ctx, ctx->mntpoint, _("Could not create workqueue."));
+ str_info(ctx, ctx->mntpoint, _("Could not create workqueue."));
return false;
}
if (ctx->fsinfo.fs_rt) {
@@ -225,7 +225,7 @@ xfs_scan_all_spacemaps(
ctx->geo.agcount + 1, &sbx);
if (ret) {
sbx.moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue rtdev fsmap work."));
goto out;
}
@@ -235,7 +235,7 @@ _("Could not queue rtdev fsmap work."));
ctx->geo.agcount + 2, &sbx);
if (ret) {
sbx.moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue logdev fsmap work."));
goto out;
}
@@ -244,7 +244,7 @@ _("Could not queue logdev fsmap work."));
ret = workqueue_add(&wq, xfs_scan_ag_blocks, agno, &sbx);
if (ret) {
sbx.moveon = false;
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue AG %u fsmap work."), agno);
break;
}
diff --git a/scrub/vfs.c b/scrub/vfs.c
index 573a2d0dcd..0c5b35351c 100644
--- a/scrub/vfs.c
+++ b/scrub/vfs.c
@@ -145,7 +145,7 @@ scan_fs_dir(
pthread_mutex_unlock(&sft->lock);
error = workqueue_add(wq, scan_fs_dir, 0, new_sftd);
if (error) {
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue subdirectory scan work."));
sft->moveon = false;
break;
@@ -203,12 +203,12 @@ scan_fs_tree(
ret = workqueue_create(&wq, (struct xfs_mount *)ctx,
scrub_nproc_workqueue(ctx));
if (ret) {
- str_error(ctx, ctx->mntpoint, _("Could not create workqueue."));
+ str_info(ctx, ctx->mntpoint, _("Could not create workqueue."));
goto out_free;
}
ret = workqueue_add(&wq, scan_fs_dir, 0, sftd);
if (ret) {
- str_error(ctx, ctx->mntpoint,
+ str_info(ctx, ctx->mntpoint,
_("Could not queue directory scan work."));
goto out_free;
}