aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLi Xi <lixi@ddn.com>2019-08-07 15:34:00 +0800
committerTheodore Ts'o <tytso@mit.edu>2021-01-25 15:16:28 -0500
commit464abd60f5b68716d8ac5063d90562f9ecd2b004 (patch)
tree858ed065cadf0443f235092f2d70e30988ee4e64
parent5d4f09fa148e41b4e0ea01fc364de5bbedf02ecf (diff)
downloade2fsprogs-464abd60f5b68716d8ac5063d90562f9ecd2b004.tar.gz
e2fsck: add assert when copying context
Adding the assert would simplify the copying of context. Signed-off-by: Li Xi <lixi@ddn.com> 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.c14
1 files changed, 14 insertions, 0 deletions
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index ba513d910..d16bedd35 100644
--- a/e2fsck/pass1.c
+++ b/e2fsck/pass1.c
@@ -46,6 +46,7 @@
#ifdef HAVE_ERRNO_H
#include <errno.h>
#endif
+#include <assert.h>
#include "e2fsck.h"
#include <ext2fs/ext2_ext_attr.h>
@@ -2129,6 +2130,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");