diff mbox series

[RFC,v3,55/61] e2fsck: fix readahead for pass1 without pfsck

Message ID 20201118153947.3394530-56-saranyamohan@google.com
State New
Headers show
Series Introduce parallel fsck to e2fsck pass1 | expand

Commit Message

Saranya Muruganandam Nov. 18, 2020, 3:39 p.m. UTC
From: Wang Shilong <wshilong@ddn.com>

If admin try fsck without -m option, codes try old
behavior, thread information won't be inited either.
@et_group_end is 0 thus readahead for pass1 will be
totally disabled.

With the patch applied, we could get same performance
number without pfsck as before.

Signed-off-by: Wang Shilong <wshilong@ddn.com>
Signed-off-by: Saranya Muruganandam <saranyamohan@google.com>
---
 e2fsck/pass1.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index 3899d710..70826866 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -1100,7 +1100,8 @@  static void pass1_readahead(e2fsck_t ctx, dgrp_t *group, ext2_ino_t *next_ino)
 	errcode_t err = EXT2_ET_INVALID_ARGUMENT;
 
 #ifdef CONFIG_PFSCK
-	grp_end = ctx->thread_info.et_group_end;
+	if (ctx->fs->fs_num_threads > 1)
+		grp_end = ctx->thread_info.et_group_end;
 #endif
 	if (ctx->readahead_kb == 0)
 		goto out;