diff mbox series

[2/4] xfs_scrub: fix threadcount estimates for phase 6

Message ID 171079733004.3790235.15832282031548480309.stgit@frogsfrogsfrogs (mailing list archive)
State Superseded
Headers show
Series [1/4] xfs_db: fix alignment checks in getbitval | expand

Commit Message

Darrick J. Wong March 18, 2024, 9:30 p.m. UTC
From: Darrick J. Wong <djwong@kernel.org>

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 <djwong@kernel.org>
---
 scrub/phase6.c |    4 ++++
 1 file changed, 4 insertions(+)
diff mbox series

Patch

diff --git a/scrub/phase6.c b/scrub/phase6.c
index 99a32bc79620..98d6f08e4727 100644
--- a/scrub/phase6.c
+++ b/scrub/phase6.c
@@ -744,6 +744,10 @@  phase6_estimate(
 	*items = cvt_off_fsb_to_b(&ctx->mnt,
 			(d_blocks - d_bfree) + (r_blocks - r_bfree));
 	*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;
 }