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>
Reviewed-by: Christoph Hellwig <hch@lst.de>
const struct histogram *freesp_hist)
{
uint64_t ret;
- double blk_threshold = 0;
unsigned int ag_max_usable;
/*
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;