From: Darrick J. Wong Date: Tue, 9 Jun 2026 16:53:36 +0000 (-0700) Subject: xfs_scrub: fix phase 8 debug reporting X-Git-Tag: v7.1.0~21 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=f4dfa0b0c56573989448cb0d22f9e5d63358ff0b;p=xfsprogs-dev.git xfs_scrub: fix phase 8 debug reporting 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: # v6.10.0 Fixes: 34bed605490f93 ("xfs_scrub: tune fstrim minlen parameter based on free space histograms") Signed-off-by: "Darrick J. Wong" Reviewed-by: Christoph Hellwig --- diff --git a/scrub/phase8.c b/scrub/phase8.c index 5bfe0ffb..61f412f7 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;