Skip to contentSkip to conversation

xfs_scrub: don't ask user to run xfs_repair for only warnings

PATCH In review Darrick J. Wong 2 participants 2 messages Feb 21, 2018

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xfs_scrub: don't ask user to run xfs_repair for only warnings

From: Darrick J. Wong <[email protected]>

Don't advise the user to run xfs_repair on a filesystem that triggers warnings but no errors; there's no corruption for it to fix.

---
 scrub/xfs_scrub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scrub/xfs_scrub.c +1 -1
index ab26e63..53a105a 100644
@@ -514,7 +514,7 @@ report_outcome(
 		fprintf(stderr, _("%s: errors found: %llu; warnings found: %llu\n"),
 				ctx->mntpoint, total_errors,
 				ctx->warnings_found);
-	if (ctx->need_repair)
+	if (ctx->need_repair && total_errors > 0)
 		fprintf(stderr, _("%s: Unmount and run xfs_repair.\n"),
 				ctx->mntpoint);
 }
Reviewed-by on v1 1/1
#1 lore raw
Quoted 6 lines · Darrick J. Wong

From: Darrick J. Wong <[email protected]>

Don't advise the user to run xfs_repair on a filesystem that triggers warnings but no errors; there's no corruption for it to fix.

looks fine.

Quoted 21 lines
---
 scrub/xfs_scrub.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
scrub/xfs_scrub.c +1 -2
index ab26e63..53a105a 100644
@@ -514,7 +514,7 @@ report_outcome(
 		fprintf(stderr, _("%s: errors found: %llu; warnings found: %llu\n"),
 				ctx->mntpoint, total_errors,
 				ctx->warnings_found);
-	if (ctx->need_repair)
+	if (ctx->need_repair && total_errors > 0)
 		fprintf(stderr, _("%s: Unmount and run xfs_repair.\n"),
 				ctx->mntpoint);
 }
--

To unsubscribe from this list: send the line "unsubscribe linux-xfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html