From: Wang Shilong Date: Sun, 27 Sep 2020 13:25:07 +0000 (+0800) Subject: LU-8465 e2fsck: fix readahead for pass1 without pfsck X-Git-Tag: v1.45.6.wc2~4 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=b4d8cf38c59cd4e85d3816368a2434891e16e84d;p=tools%2Fe2fsprogs.git 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 --- 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;