From e98616ba9dc9bc457dcc111f97b33a88c6221850 Mon Sep 17 00:00:00 2001 From: "Darrick J. Wong" Date: Fri, 1 Nov 2019 17:55:06 -0400 Subject: [PATCH] xfs_scrub: fix misclassified error reporting Fix a few places where we assign error reports to the wrong classification. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- scrub/fscounters.c | 2 +- scrub/inodes.c | 4 ++-- scrub/phase1.c | 2 +- scrub/xfs_scrub.c | 2 +- 4 files changed, 5 insertions(+), 5 deletions(-) diff --git a/scrub/fscounters.c b/scrub/fscounters.c index 98aa3826e..e064c865d 100644 --- a/scrub/fscounters.c +++ b/scrub/fscounters.c @@ -48,7 +48,7 @@ xfs_count_inodes_ag( ireq = xfrog_inumbers_alloc_req(64, 0); if (!ireq) { - str_info(ctx, descr, _("Insufficient memory; giving up.")); + str_liberror(ctx, ENOMEM, _("allocating inumbers request")); return false; } xfrog_inumbers_set_ag(ireq, agno); diff --git a/scrub/inodes.c b/scrub/inodes.c index 7c04d7f6c..71e53bb61 100644 --- a/scrub/inodes.c +++ b/scrub/inodes.c @@ -126,13 +126,13 @@ xfs_iterate_inodes_ag( breq = xfrog_bulkstat_alloc_req(XFS_INODES_PER_CHUNK, 0); if (!breq) { - str_info(ctx, descr, _("Insufficient memory; giving up.")); + str_liberror(ctx, ENOMEM, _("allocating bulkstat request")); return false; } ireq = xfrog_inumbers_alloc_req(1, 0); if (!ireq) { - str_info(ctx, descr, _("Insufficient memory; giving up.")); + str_liberror(ctx, ENOMEM, _("allocating inumbers request")); free(breq); return false; } diff --git a/scrub/phase1.c b/scrub/phase1.c index 3211a488a..d040c4a89 100644 --- a/scrub/phase1.c +++ b/scrub/phase1.c @@ -127,7 +127,7 @@ _("Not an XFS filesystem.")); if (!xfs_action_lists_alloc(ctx->mnt.fsgeom.agcount, &ctx->action_lists)) { - str_error(ctx, ctx->mntpoint, _("Not enough memory.")); + str_liberror(ctx, ENOMEM, _("allocating action lists")); return false; } diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index 147c114c8..e9fc3650d 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -738,7 +738,7 @@ main( str_info(&ctx, ctx.mntpoint, _("Too many errors; aborting.")); if (debug_tweak_on("XFS_SCRUB_FORCE_ERROR")) - str_error(&ctx, ctx.mntpoint, _("Injecting error.")); + str_info(&ctx, ctx.mntpoint, _("Injecting error.")); /* Clean up scan data. */ moveon = xfs_cleanup_fs(&ctx); -- 2.50.1