diff options
author | Wang Shilong <wshilong@ddn.com> | 2020-04-16 15:08:31 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2021-01-25 15:18:32 -0500 |
commit | 2c1e9ced674f0d8e634c3b6299ce9bdfbe4b8739 (patch) | |
tree | 7a8b9ee16af0f2a5085adcfdca4430bf051a6c48 | |
parent | 41c991af7ed7244da0fd799f63e4e6fd0d6c5b25 (diff) | |
download | e2fsprogs-2c1e9ced674f0d8e634c3b6299ce9bdfbe4b8739.tar.gz |
e2fsck: set E2F_FLAG_ALLOC_OK after threads
Only flag ALLOC OK after all threads finished without problem.
Signed-off-by: Wang Shilong <wshilong@ddn.com>
Reviewed-by: Andreas Dilger <adilger@whamcloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
-rw-r--r-- | e2fsck/pass1.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index 6cf7f3d8d..ae553a121 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -1380,9 +1380,12 @@ static void e2fsck_pass1_post(e2fsck_t ctx) { struct problem_context pctx; ext2_filsys fs = ctx->fs; + char *block_buf; - char *block_buf = - (char *)e2fsck_allocate_memory(ctx, ctx->fs->blocksize * 3, + if (e2fsck_should_abort(ctx)) + return; + + block_buf = (char *)e2fsck_allocate_memory(ctx, ctx->fs->blocksize * 3, "block interate buffer"); reserve_block_for_root_repair(ctx); reserve_block_for_lnf_repair(ctx); @@ -1460,6 +1463,8 @@ static void e2fsck_pass1_post(e2fsck_t ctx) ext2fs_free_mem(&block_buf); ctx->flags &= ~E2F_FLAG_DUP_BLOCK; } + + ctx->flags |= E2F_FLAG_ALLOC_OK; } @@ -2291,6 +2296,7 @@ void e2fsck_pass1_run(e2fsck_t ctx) } ctx->flags |= E2F_FLAG_ALLOC_OK; + ext2fs_free_mem(&inodes_to_process); endit: e2fsck_use_inode_shortcuts(ctx, 0); ext2fs_free_mem(&inodes_to_process); |