Re: [PATCH 3/3] xfs_scrub: relabel verified data block counts in output

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Ok, you can add my review:
Reviewed-by: Allison Collins <allison.henderson@xxxxxxxxxx>

On 9/5/19 8:40 PM, Darrick J. Wong wrote:
From: Darrick J. Wong <darrick.wong@xxxxxxxxxx>

Relabel the count of verified data blocks to make it more obvious that
we were only looking for file data.

Signed-off-by: Darrick J. Wong <darrick.wong@xxxxxxxxxx>
---
  scrub/phase7.c    |   13 ++++++++-----
  scrub/xfs_scrub.c |    2 ++
  2 files changed, 10 insertions(+), 5 deletions(-)


diff --git a/scrub/phase7.c b/scrub/phase7.c
index 570ceb3f..2622bc45 100644
--- a/scrub/phase7.c
+++ b/scrub/phase7.c
@@ -116,6 +116,7 @@ xfs_scan_summary(
  	unsigned long long	f_free;
  	bool			moveon;
  	bool			complain;
+	bool			scrub_all = scrub_data > 1;
  	int			ip;
  	int			error;
@@ -244,14 +245,15 @@ _("%.*f%s inodes counted; %.*f%s inodes checked.\n"),
  	}
/*
-	 * Complain if the checked block counts are off, which
+	 * Complain if the data file verification block counts are off, which
  	 * implies an incomplete check.
  	 */
-	if (ctx->bytes_checked &&
+	if (scrub_data &&
  	    (verbose ||
  	     !within_range(ctx, used_data + used_rt,
  			ctx->bytes_checked, absdiff, 1, 10,
-			_("verified blocks")))) {
+			scrub_all ? _("verified blocks") :
+				    _("verified file data blocks")))) {
  		double		b1, b2;
  		char		*b1u, *b2u;
@@ -262,8 +264,9 @@ _("%.*f%s inodes counted; %.*f%s inodes checked.\n"), b1 = auto_space_units(used_data + used_rt, &b1u);
  		b2 = auto_space_units(ctx->bytes_checked, &b2u);
-		fprintf(stdout,
-_("%.1f%s data counted; %.1f%s data verified.\n"),
+		fprintf(stdout, scrub_all ?
+_("%.1f%s data counted; %.1f%s disk media verified.\n") :
+_("%.1f%s data counted; %.1f%s file data media verified.\n"),
  				b1, b1u, b2, b2u);
  		fflush(stdout);
  	}
diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c
index 46876522..89f6c96a 100644
--- a/scrub/xfs_scrub.c
+++ b/scrub/xfs_scrub.c
@@ -432,6 +432,8 @@ run_scrub_phases(
  		/* Turn on certain phases if user said to. */
  		if (sp->fn == DATASCAN_DUMMY_FN && scrub_data) {
  			sp->fn = xfs_scan_blocks;
+			if (scrub_data > 1)
+				sp->descr = _("Verify disk integrity.");
  		} else if (sp->fn == REPAIR_DUMMY_FN &&
  			   ctx->mode == SCRUB_MODE_REPAIR) {
  			sp->descr = _("Repair filesystem.");




[Index of Archives]     [XFS Filesystem Development (older mail)]     [Linux Filesystem Development]     [Linux Audio Users]     [Yosemite Trails]     [Linux Kernel]     [Linux RAID]     [Linux SCSI]


  Powered by Linux