[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <1592494074-28991-48-git-send-email-wangshilong1991@gmail.com>
Date: Fri, 19 Jun 2020 00:27:50 +0900
From: Wang Shilong <wangshilong1991@...il.com>
To: linux-ext4@...r.kernel.org
Cc: lixi@....com, adilger@...ger.ca, wangshilong1991@...il.com,
sihara@....com, Wang Shilong <wshilong@....com>
Subject: [RFC PATCH v2 47/51] e2fsck: only set E2F_FLAG_ALLOC_OK if all threads succeed
From: Wang Shilong <wshilong@....com>
Signed-off-by: Wang Shilong <wshilong@....com>
---
e2fsck/pass1.c | 10 +++++++---
1 file changed, 7 insertions(+), 3 deletions(-)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index d56b7128..45e8090b 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -1375,9 +1375,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);
@@ -1455,6 +1458,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;
}
@@ -2309,7 +2314,6 @@ void _e2fsck_pass1(e2fsck_t ctx)
goto endit;
}
- ctx->flags |= E2F_FLAG_ALLOC_OK;
endit:
e2fsck_use_inode_shortcuts(ctx, 0);
ext2fs_free_mem(&inodes_to_process);
--
2.25.4
Powered by blists - more mailing lists