From: Li Xi Date: Wed, 7 Aug 2019 07:34:00 +0000 (+0800) Subject: e2fsck: add assert when copying context X-Git-Tag: v1.46.6-wc1~88 X-Git-Url: https://git.whamcloud.com/gitweb?a=commitdiff_plain;h=e1abb3cd819986e1d5caa53bf91c0759de722ec8;p=tools%2Fe2fsprogs.git e2fsck: add assert when copying context Adding the assert would simplify the copying of context. E2fsprogs-commit: 464abd60f5b68716d8ac5063d90562f9ecd2b004 Change-Id: I8276c2e90f40b08dea28b157e04df3c0f7099211 Signed-off-by: Li Xi Signed-off-by: Wang Shilong Reviewed-by: Andreas Dilger Signed-off-by: Theodore Ts'o --- diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c index cd70fe1..b48b893 100644 --- a/e2fsck/pass1.c +++ b/e2fsck/pass1.c @@ -47,6 +47,7 @@ #ifdef HAVE_ERRNO_H #include #endif +#include #include "e2fsck.h" #include @@ -2166,6 +2167,19 @@ static errcode_t e2fsck_pass1_thread_prepare(e2fsck_t global_ctx, e2fsck_t *thre ext2_filsys thread_fs; ext2_filsys global_fs = global_ctx->fs; + assert(global_ctx->inode_used_map == NULL); + assert(global_ctx->inode_dir_map == NULL); + assert(global_ctx->inode_bb_map == NULL); + assert(global_ctx->inode_imagic_map == NULL); + assert(global_ctx->inode_reg_map == NULL); + assert(global_ctx->inodes_to_rebuild == NULL); + + assert(global_ctx->block_found_map == NULL); + assert(global_ctx->block_dup_map == NULL); + assert(global_ctx->block_ea_map == NULL); + assert(global_ctx->block_metadata_map == NULL); + assert(global_ctx->fs->dblist == NULL); + retval = ext2fs_get_mem(sizeof(struct e2fsck_struct), &thread_context); if (retval) { com_err(global_ctx->program_name, retval, "while allocating memory");