diff mbox series

[RFCv1,71/72] e2fsck: Make threads call log_out after pthread_join

Message ID 6a1aa669f380236663941522f84acf840919aac0.1667822612.git.ritesh.list@gmail.com
State Under Review
Delegated to: Theodore Ts'o
Headers show
Series e2fsprogs: Parallel fsck support | expand

Commit Message

Ritesh Harjani (IBM) Nov. 7, 2022, 12:21 p.m. UTC
All fsck threads will call for log_out prints after the pass1 their
respective pass1 scanning is completed. This patch moves the log_out
print from to after the pthread_join operation.
This makes the threads always print the info in order.

Signed-off-by: Ritesh Harjani (IBM) <ritesh.list@gmail.com>
---
 e2fsck/pass1.c | 13 ++++++-------
 1 file changed, 6 insertions(+), 7 deletions(-)
diff mbox series

Patch

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 2ff83fcb..90adc419 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -3112,6 +3112,12 @@  static int e2fsck_pass1_thread_join(e2fsck_t global_ctx, e2fsck_t thread_ctx)
 {
 	errcode_t retval;
 
+	log_out(thread_ctx,
+			_("Scanned group range [%u, %u), inodes %u\n"),
+			thread_ctx->thread_info.et_group_start,
+			thread_ctx->thread_info.et_group_end,
+			thread_ctx->thread_info.et_inode_number);
+
 	retval = e2fsck_pass1_merge_context(global_ctx, thread_ctx);
 
 	quota_release_context(&thread_ctx->qctx);
@@ -3203,13 +3209,6 @@  static void *e2fsck_pass1_thread(void *arg)
 	e2fsck_pass1_run(thread_ctx);
 
 out:
-	if (thread_ctx->options & E2F_OPT_MULTITHREAD)
-		log_out(thread_ctx,
-			_("Scanned group range [%u, %u), inodes %u\n"),
-			thread_ctx->thread_info.et_group_start,
-			thread_ctx->thread_info.et_group_end,
-			thread_ctx->thread_info.et_inode_number);
-
 #ifdef DEBUG_THREADS
 	pthread_mutex_lock(&thread_debug->etd_mutex);
 	thread_debug->etd_finished_threads++;