diff --git a/0049-fix-threadcount-estimates-for-phase-6.patch b/0049-fix-threadcount-estimates-for-phase-6.patch new file mode 100644 index 0000000000000000000000000000000000000000..c35c4b806893723a2fb9a3a2c1b6d354fc91e40b --- /dev/null +++ b/0049-fix-threadcount-estimates-for-phase-6.patch @@ -0,0 +1,42 @@ +From 13eedd45afb39354a9fe5089d86f4eff1a94ac79 Mon Sep 17 00:00:00 2001 +From: "Darrick J. Wong" +Date: Mon, 15 Apr 2024 16:07:46 -0700 +Subject: xfs_scrub: fix threadcount estimates for phase 6 + +If a filesystem has a realtime device or an external log device, the +media scan can start up a separate readverify controller (and workqueue) +to handle that. Each of those controllers can call progress_add, so we +need to bump up nr_threads so that the progress reports controller knows +to make its ptvar big enough to handle all these threads. + +Signed-off-by: Darrick J. Wong +Reviewed-by: Christoph Hellwig +--- + scrub/phase6.c | 10 ++++++++++ + 1 file changed, 10 insertions(+) + +diff --git a/scrub/phase6.c b/scrub/phase6.c +index 87828b6..c5bfd74 100644 +--- a/scrub/phase6.c ++++ b/scrub/phase6.c +@@ -731,7 +731,17 @@ phase6_estimate( + + *items = cvt_off_fsb_to_b(&ctx->mnt, + (d_blocks - d_bfree) + (r_blocks - r_bfree)); ++ ++ /* ++ * Each read-verify pool starts a thread pool, and each worker thread ++ * can contribute to the progress counter. Hence we need to set ++ * nr_threads appropriately to handle that many threads. ++ */ + *nr_threads = disk_heads(ctx->datadev); ++ if (ctx->rtdev) ++ *nr_threads += disk_heads(ctx->rtdev); ++ if (ctx->logdev) ++ *nr_threads += disk_heads(ctx->logdev); + *rshift = 20; + return 0; + } +-- +2.33.0 + diff --git a/xfsprogs.spec b/xfsprogs.spec index 9e9a46e0e1379db4bbbb9a17bfc934786142ad9b..1ce38bb8e806c076d6e39269b1648db11d268696 100644 --- a/xfsprogs.spec +++ b/xfsprogs.spec @@ -1,6 +1,6 @@ Name: xfsprogs Version: 5.14.1 -Release: 17 +Release: 18 Summary: Administration and debugging tools for the XFS file system License: GPL+ and LGPLv2+ URL: https://xfs.wiki.kernel.org @@ -67,6 +67,7 @@ Patch45: 0045-xfs_db-fix-dir3-block-magic-check.patch Patch46: 0046-xfs_repair-fix-incorrect-dabtree-hashval-comparison.patch Patch47: 0047-xfs_scrub-handle-spurious-wakeups-in-scan_fs_tree.patch Patch48: 0048-xfs_scrub-fix-reporting-if-we-can-t-open-raw-block-d.patch +Patch49: 0049-fix-threadcount-estimates-for-phase-6.patch %description @@ -151,6 +152,9 @@ rm -rf %{buildroot}%{_datadir}/doc/xfsprogs/ %changelog +* Fri Nov 14 2025 xuchenchen - 5.14.1-18 +- xfs_scrub: fix threadcount estimates for phase 6 + * Mon Nov 3 2025 xuchenchen - 5.14.1-17 - xfs_scrub: fix reporting if we can't open raw block devices