Whamcloud - gitweb
e2fsck: merge extent depth count after threads finish
authorWang Shilong <wshilong@ddn.com>
Fri, 20 Mar 2020 01:55:18 +0000 (09:55 +0800)
committerAndreas Dilger <adilger@whamcloud.com>
Mon, 19 Sep 2022 23:16:08 +0000 (17:16 -0600)
tests covered by f_extent_htree.

E2fsprogs-commit: 291bc9b7fc5280166e58b0e586d5ec93738f31a7

Change-Id: I5b4f629e1031f719a2d032a9dd5edb1cfac90975
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
e2fsck/pass1.c

index 5e7f946..ca9f03b 100644 (file)
@@ -2972,8 +2972,11 @@ static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_ctx
        ext2_refcount_t ea_inode_refs = global_ctx->ea_inode_refs;
        ext2fs_block_bitmap  block_found_map = global_ctx->block_found_map;
        ext2fs_block_bitmap  block_dup_map = global_ctx->block_dup_map;
-       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;
 
@@ -3033,6 +3036,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) {