Whamcloud - gitweb
LU-8465 e2fsck: merge extent depth count after threads finish 00/38000/10
authorWang Shilong <wshilong@ddn.com>
Fri, 20 Mar 2020 01:55:18 +0000 (09:55 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Sat, 26 Sep 2020 06:36:20 +0000 (06:36 +0000)
tests covered by f_extent_htree.

Change-Id: Ica5a61ce9fbf73770eb014e0e938148cccb1b357
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-on: https://review.whamcloud.com/38000
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Tested-by: jenkins <devops@whamcloud.com>
Tested-by: Maloo <maloo@whamcloud.com>
e2fsck/pass1.c

index b6a9da7..3a65679 100644 (file)
@@ -3209,8 +3209,11 @@ static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_ctx
        ext2fs_block_bitmap  block_found_map = global_ctx->block_found_map;
        ext2fs_block_bitmap  block_dup_map = global_ctx->block_dup_map;
        ext2_u32_list encrypted_dirs = global_ctx->encrypted_dirs;
-       int options = global_ctx->options;
+       int options = global_ctx->options, i;
+       __u32 extent_depth_count[MAX_EXTENT_DEPTH_COUNT];
 
+       memcpy(extent_depth_count, global_ctx->extent_depth_count,
+              sizeof(extent_depth_count));
 #ifdef HAVE_SETJMP_H
        jmp_buf          old_jmp;
 
@@ -3271,6 +3274,12 @@ static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_ctx
         * later passes will recalculate it if necessary
         */
        global_ctx->lost_and_found = 0;
+       memcpy(global_ctx->extent_depth_count, extent_depth_count,
+              sizeof(extent_depth_count));
+       /* merge extent depth count */
+       for (i = 0; i < MAX_EXTENT_DEPTH_COUNT; i++)
+               global_ctx->extent_depth_count[i] +=
+                       thread_ctx->extent_depth_count[i];
 
        retval = e2fsck_pass1_merge_fs(global_fs, thread_fs);
        if (retval) {