From: Darrick J. Wong Date: Mon, 12 Feb 2018 21:47:52 +0000 (-0600) Subject: xfs_scrub: reclassify runtime errors X-Git-Tag: v4.15.0-rc1~4 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=82377bde20e9d52b167d8517d68423ccf47a9ebc;p=thirdparty%2Fxfsprogs-dev.git 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 Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/scrub/fscounters.c b/scrub/fscounters.c index 4294bf31b..ecdf4c612 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 23ec70444..57b773ee7 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 82c80223b..6cd544233 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 32e2752ef..edf66df6a 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 f4117b013..a0ee5d9e3 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 9795bf3b0..f9859509e 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 e816688ba..ae2e85fc8 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 bc0e2f050..ff5357c65 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 2dc6e2b88..f63191300 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 573a2d0dc..0c5b35351 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; }