All of lore.kernel.org
 help / color / mirror / Atom feed
From: "Darrick J. Wong" <djwong@kernel.org>
To: aalbersh@kernel.org, djwong@kernel.org
Cc: linux-xfs@vger.kernel.org, linux-xfs@vger.kernel.org, hch@lst.de
Subject: [PATCH 7/8] xfs_scrub: fix phase 8 debug reporting
Date: Thu, 25 Jun 2026 15:56:02 -0700	[thread overview]
Message-ID: <178242801433.1981574.13587205107962897238.stgit@frogsfrogsfrogs> (raw)
In-Reply-To: <178242801268.1981574.8079691316092703702.stgit@frogsfrogsfrogs>

From: Darrick J. Wong <djwong@kernel.org>

Codex observes that the debug printf in fstrim_compute_minlen always
prints a threshold of 0 because we never actually set the block
threshold variable.  Fix that by using the results of the
multiplication that's passed into minlen_for_threshold.

Cc: <linux-xfs@vger.kernel.org> # v6.10.0
Fixes: 34bed605490f93 ("xfs_scrub: tune fstrim minlen parameter based on free space histograms")
Signed-off-by: "Darrick J. Wong" <djwong@kernel.org>
---
 scrub/phase8.c |    5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)


diff --git a/scrub/phase8.c b/scrub/phase8.c
index 5bfe0ffb4868a2..61f412f7139ae9 100644
--- a/scrub/phase8.c
+++ b/scrub/phase8.c
@@ -141,7 +141,6 @@ fstrim_compute_minlen(
 	const struct histogram	*freesp_hist)
 {
 	uint64_t		ret;
-	double			blk_threshold = 0;
 	unsigned int		ag_max_usable;
 
 	/*
@@ -164,9 +163,9 @@ fstrim_compute_minlen(
 			freesp_hist->tot_sum * ctx->fstrim_block_pct);
 
 	if (debug > 1)
-		printf(_("fstrim minlen %lld threshold %lld ag_max_usable %u\n"),
+		printf(_("fstrim minlen %lld threshold %.2f ag_max_usable %u\n"),
 				(unsigned long long)ret,
-				(unsigned long long)blk_threshold,
+				freesp_hist->tot_sum * ctx->fstrim_block_pct,
 				ag_max_usable);
 	if (ret > ag_max_usable)
 		ret = ag_max_usable;


  parent reply	other threads:[~2026-06-25 22:56 UTC|newest]

Thread overview: 22+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-25 22:54 [PATCHSET] xfs_scrub: codex-inspired bug fixes, part 3 Darrick J. Wong
2026-06-25 22:54 ` [PATCH 1/8] xfs_scrub: stop user file scan if caller already aborte Darrick J. Wong
2026-06-26  4:58   ` Christoph Hellwig
2026-06-26 16:46     ` Darrick J. Wong
2026-06-25 22:54 ` [PATCH 2/8] xfs_scrub: don't flatten error numbers in read_verify_schedule_now Darrick J. Wong
2026-06-26  4:58   ` Christoph Hellwig
2026-06-25 22:54 ` [PATCH 3/8] xfs_scrub: actually handle NEEDSCHECK scrub items in phase 4 Darrick J. Wong
2026-06-26  4:59   ` Christoph Hellwig
2026-06-25 22:55 ` [PATCH 4/8] xfs_scrub: fix spacemap external log device scan dev key Darrick J. Wong
2026-06-26  5:03   ` Christoph Hellwig
2026-06-26 17:09     ` Darrick J. Wong
2026-06-29 12:26       ` Christoph Hellwig
2026-06-25 22:55 ` [PATCH 5/8] xfs_scrub: fix estimate of work items for phase 4 Darrick J. Wong
2026-06-26  5:04   ` Christoph Hellwig
2026-06-26 16:55     ` Darrick J. Wong
2026-06-29 12:25       ` Christoph Hellwig
2026-06-25 22:55 ` [PATCH 6/8] xfs_scrub: don't leak phase 5 scan items after a failed workqueue_add Darrick J. Wong
2026-06-26  5:04   ` Christoph Hellwig
2026-06-25 22:56 ` Darrick J. Wong [this message]
2026-06-26  5:05   ` [PATCH 7/8] xfs_scrub: fix phase 8 debug reporting Christoph Hellwig
2026-06-25 22:56 ` [PATCH 8/8] xfs_scrub: always finish cleanup, even if reporting healthy state fails Darrick J. Wong
2026-06-26  5:05   ` Christoph Hellwig

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=178242801433.1981574.13587205107962897238.stgit@frogsfrogsfrogs \
    --to=djwong@kernel.org \
    --cc=aalbersh@kernel.org \
    --cc=hch@lst.de \
    --cc=linux-xfs@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.