Whamcloud - gitweb
LU-8465 e2fsck: fix readahead for pass1 without pfsck 66/40066/4
authorWang Shilong <wshilong@ddn.com>
Sun, 27 Sep 2020 13:25:07 +0000 (21:25 +0800)
committerWang Shilong <wshilong@whamcloud.com>
Mon, 28 Sep 2020 13:05:38 +0000 (13:05 +0000)
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>
Change-Id: I3f6158937fb83490243f34693f631a2d7a8f9e4c
Reviewed-on: https://review.whamcloud.com/40066
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
e2fsck/pass1.c

index aa40218..ebcebf9 100644 (file)
@@ -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;