]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: reclassify runtime errors
authorDarrick J. Wong <darrick.wong@oracle.com>
Mon, 12 Feb 2018 21:47:52 +0000 (15:47 -0600)
committerEric Sandeen <sandeen@redhat.com>
Mon, 12 Feb 2018 21:47:52 +0000 (15:47 -0600)
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>
scrub/fscounters.c
scrub/inodes.c
scrub/phase1.c
scrub/phase2.c
scrub/phase3.c
scrub/phase6.c
scrub/read_verify.c
scrub/scrub.c
scrub/spacemap.c
scrub/vfs.c

index 4294bf31b305cb55a796ec5246f6b02973a1c442..ecdf4c61263156948be075b99d6ad2bc8f83aad5 100644 (file)
@@ -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;
                }
index 23ec7044431d28d51da243e5da905681e157958e..57b773ee7638b55b035205ffd663eb01bb99a0cd 100644 (file)
@@ -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;
                }
index 82c80223b364cf51a332d9016c1f32a93a226bd3..6cd544233c94728fad881a1cf84396f1738c6bf3 100644 (file)
@@ -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;
        }
index 32e2752efda1b503bfb359b9cb2150a6de39a3c5..edf66df6a7fa9c0243a2f9d8f403d72bc4783000 100644 (file)
@@ -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;
        }
index f4117b013a4eea14e18b62cb99bb417aebf8c03a..a0ee5d9e3f65d141b44772928699245757b34f56 100644 (file)
@@ -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;
        }
 
index 9795bf3b0e68c1f99c4ef9c73e0f2848679d4885..f9859509e64390590151266466120d6857da96ce 100644 (file)
@@ -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;
        }
index e816688ba44c5ee1ab4fb8c3a9d01b2a72ba4e53..ae2e85fc8675389672f89f6cc5489fe08b94663a 100644 (file)
@@ -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;
index bc0e2f050263a2f2fcedd185a6121ec44577c6ad..ff5357c6518c21dc46df74c5ceb39b7858e79a1f 100644 (file)
@@ -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:
index 2dc6e2b8848aa6ce21f3dffa74b785418984532e..f6319130021010788640719a68e47f4cc3815cd1 100644 (file)
@@ -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;
                }
index 573a2d0dcd104d0c858a1219d3d43ec2276eb19f..0c5b35351cffcd35dd456e574751093c5c27e9a9 100644 (file)
@@ -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;
        }