From: Darrick J. Wong Date: Wed, 6 Nov 2019 22:26:35 +0000 (-0500) Subject: xfs_scrub: bump work_threads to include the controller thread X-Git-Tag: v5.3.0-rc2~31 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=51c940530e315a65a76ac6936893b4449cfbd5c8;p=thirdparty%2Fxfsprogs-dev.git xfs_scrub: bump work_threads to include the controller thread Bump @work_threads in the scrub phase setup function because we will soon want the main thread (i.e. the one that coordinates workers) to be factored into per-thread data structures. We'll need this in an upcoming patch to render error string prefixes to preallocated per-thread buffers. Signed-off-by: Darrick J. Wong Reviewed-by: Eric Sandeen Signed-off-by: Eric Sandeen --- diff --git a/scrub/xfs_scrub.c b/scrub/xfs_scrub.c index 963d0d704..fe76d0755 100644 --- a/scrub/xfs_scrub.c +++ b/scrub/xfs_scrub.c @@ -458,6 +458,13 @@ run_scrub_phases( &work_threads, &rshift); if (!moveon) break; + + /* + * The thread that starts the worker threads is also + * allowed to contribute to the progress counters and + * whatever other per-thread data we need to allocate. + */ + work_threads++; moveon = progress_init_phase(ctx, progress_fp, phase, max_work, rshift, work_threads); } else {