]> git.ipfire.org Git - thirdparty/xfsprogs-dev.git/commitdiff
xfs_scrub: bump work_threads to include the controller thread
authorDarrick J. Wong <darrick.wong@oracle.com>
Wed, 6 Nov 2019 22:26:35 +0000 (17:26 -0500)
committerEric Sandeen <sandeen@sandeen.net>
Wed, 6 Nov 2019 22:26:35 +0000 (17:26 -0500)
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 <darrick.wong@oracle.com>
Reviewed-by: Eric Sandeen <sandeen@redhat.com>
Signed-off-by: Eric Sandeen <sandeen@sandeen.net>
scrub/xfs_scrub.c

index 963d0d7044b734b0ac9cc0609af5b6c52ba157a2..fe76d0755323780506ea92b693e120622600a3d9 100644 (file)
@@ -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 {