From: Wang Shilong Date: Thu, 19 Mar 2020 14:05:30 +0000 (+0800) Subject: e2fsck: merge options after threads finish X-Git-Tag: v1.47.0-wc1~53 X-Git-Url: https://git.whamcloud.com/?a=commitdiff_plain;h=01874e1070d6f85a9d161dc6a09e6ecce5bdfe15;p=tools%2Fe2fsprogs.git e2fsck: merge options after threads finish It will be possible that threads might append E2F_OPT_YES, so we need merge options to global, test f_yesall cover this. E2fsprogs-commit: a68a5e890793eda2e8d7b4f7d27d23a7eeb474c5 Change-Id: I0e8bbc078fc538bd7d948ced1161506710401ab3 Signed-off-by: Wang Shilong Reviewed-by: Andreas Dilger Signed-off-by: Saranya Muruganandam Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 305aa4a..59d12f1 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -3005,6 +3005,7 @@ 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; #ifdef HAVE_SETJMP_H jmp_buf old_jmp; @@ -3057,7 +3058,8 @@ static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_ctx global_ctx->fs_fragmented += fs_fragmented; global_ctx->fs_fragmented_dir += fs_fragmented_dir; global_ctx->large_files += large_files; - + /* threads might enable E2F_OPT_YES */ + global_ctx->options |= options; global_ctx->flags |= flags; retval = e2fsck_pass1_merge_fs(global_fs, thread_fs); @@ -3092,10 +3094,7 @@ static int e2fsck_pass1_thread_join_one(e2fsck_t global_ctx, e2fsck_t thread_ctx thread_ctx->qctx); if (retval) return retval; - global_ctx->invalid_block_bitmap_flag = invalid_block_bitmap_flag; - global_ctx->invalid_inode_bitmap_flag = invalid_inode_bitmap_flag; - global_ctx->invalid_inode_table_flag = invalid_inode_table_flag; - global_ctx->invalid_bitmaps = invalid_bitmaps; + e2fsck_pass1_merge_invalid_bitmaps(global_ctx, thread_ctx); retval = e2fsck_pass1_merge_bitmap(global_fs,