]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: fix xfrog_scrub_metadata error reporting
authorDarrick J. Wong <djwong@kernel.org>
Wed, 6 Apr 2022 20:47:17 +0000 (16:47 -0400)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 6 Apr 2022 20:47:17 +0000 (16:47 -0400)
Commit de5d20ec converted xfrog_scrub_metadata to return negative error
codes directly, but forgot to fix up the str_errno calls to use
str_liberror.  This doesn't result in incorrect error reporting
currently, but (a) the calls in the switch statement are inconsistent,
and (b) this will matter in future patches where we can call library
functions in between xfrog_scrub_metadata and str_liberror.

Fixes: de5d20ec ("libfrog: convert scrub.c functions to negative error codes")
Signed-off-by: Darrick J. Wong <djwong@kernel.org>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/scrub.c

index a4b7084e47e7f91816a722e79893f78fce481254..07ae0673140b5a97b4575a5a907c13bed827ea66 100644 (file)
@@ -153,7 +153,7 @@ _("Filesystem is shut down, aborting."));
        case EIO:
        case ENOMEM:
                /* Abort on I/O errors or insufficient memory. */
-               str_errno(ctx, descr_render(&dsc));
+               str_liberror(ctx, error, descr_render(&dsc));
                return CHECK_ABORT;
        case EDEADLOCK:
        case EBUSY:
@@ -164,10 +164,10 @@ _("Filesystem is shut down, aborting."));
                 * and the other two should be reported via sm_flags.
                 */
                str_liberror(ctx, error, _("Kernel bug"));
-               fallthrough;
+               return CHECK_DONE;
        default:
                /* Operational error. */
-               str_errno(ctx, descr_render(&dsc));
+               str_liberror(ctx, error, descr_render(&dsc));
                return CHECK_DONE;
        }