From b4d8cf38c59cd4e85d3816368a2434891e16e84d Mon Sep 17 00:00:00 2001 From: Wang Shilong Date: Sun, 27 Sep 2020 21:25:07 +0800 Subject: [PATCH] LU-8465 e2fsck: fix readahead for pass1 without pfsck 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 Change-Id: I3f6158937fb83490243f34693f631a2d7a8f9e4c Reviewed-on: https://review.whamcloud.com/40066 Reviewed-by: Andreas Dilger Tested-by: jenkins Tested-by: Maloo --- e2fsck/pass1.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index aa40218..ebcebf9 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -1287,7 +1287,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; -- 1.8.3.1