[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20201118153947.3394530-6-saranyamohan@google.com>
Date: Wed, 18 Nov 2020 07:38:51 -0800
From: Saranya Muruganandam <saranyamohan@...gle.com>
To: linux-ext4@...r.kernel.org, tytso@....edu
Cc: adilger.kernel@...ger.ca, Li Xi <lixi@....com>,
Wang Shilong <wshilong@....com>,
Saranya Muruganandam <saranyamohan@...gle.com>
Subject: [RFC PATCH v3 05/61] e2fsck: add assert when copying context
From: Li Xi <lixi@....com>
Adding the assert would simplify the copying of context.
Signed-off-by: Li Xi <lixi@....com>
Signed-off-by: Wang Shilong <wshilong@....com>
Signed-off-by: Saranya Muruganandam <saranyamohan@...gle.com>
---
e2fsck/pass1.c | 14 ++++++++++++++
1 file changed, 14 insertions(+)
diff --git a/e2fsck/pass1.c b/e2fsck/pass1.c
index ba513d91..d16bedd3 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");
--
2.29.2.299.gdc1121823c-goog
Powered by blists - more mailing lists