]> git-server-git.apps.pok.os.sepia.ceph.com Git - xfsprogs-dev.git/commitdiff
xfs_scrub: fix phase 8 debug reporting
authorDarrick J. Wong <djwong@kernel.org>
Tue, 9 Jun 2026 16:53:36 +0000 (09:53 -0700)
committerDarrick J. Wong <djwong@kernel.org>
Tue, 30 Jun 2026 00:57:06 +0000 (17:57 -0700)
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>
scrub/phase8.c

index 5bfe0ffb4868a2293d78dfd6c6afde4d917de383..61f412f7139ae9e788e90d7c8e46abd55c0f1347 100644 (file)
@@ -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;