From 7142db08c4e54a863fea2e757c6d3afa42ba2290 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Mon, 8 Nov 1999 18:46:54 +0000 Subject: [PATCH] ChangeLog, e2fsck.c, pass4.c, problem.h, unix.c: pass4.c (e2fsck_pass4): Clear inode_imagic_map after freeing it, to prevent it from getting freed twice. unix.c (main): Close the filesystem before freeing the context, so that in the event of a free()-related segmentation violation, the filesystem is properly closed and written out. e2fsck.c (e2fsck_reset_context): When freeing ctx->inode_reg_map, we weren't zero'ing ctx->inode_reg_map, which could cause a segfault later on in the e2fsck run. problem.h (PR_2_SPLIT_DOT): Fix excess zero in problem code (now matches the standard convention). --- e2fsck/ChangeLog | 24 ++++++++++++++++++++++++ e2fsck/e2fsck.c | 2 +- e2fsck/pass4.c | 3 ++- e2fsck/problem.h | 2 +- e2fsck/unix.c | 3 ++- 5 files changed, 30 insertions(+), 4 deletions(-) diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index b4a2778..18a628b 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,27 @@ +1999-11-07 + + * pass4.c (e2fsck_pass4): Clear inode_imagic_map after freeing it, + to prevent it from getting freed twice. + +1999-11-06 + + * unix.c (main): Close the filesystem before freeing the context, + so that in the event of a free()-related segmentation + violation, the filesystem is properly closed and written + out. + +1999-10-27 + + * e2fsck.c (e2fsck_reset_context): When freeing + ctx->inode_reg_map, we weren't zero'ing + ctx->inode_reg_map, which could cause a segfault later on + in the e2fsck run. + +1999-10-26 + + * problem.h (PR_2_SPLIT_DOT): Fix excess zero in problem code (now + matches the standard convention). + 1999-10-26 * Release of E2fsprogs 1.17 diff --git a/e2fsck/e2fsck.c b/e2fsck/e2fsck.c index 3028c87..66e4a75 100644 --- a/e2fsck/e2fsck.c +++ b/e2fsck/e2fsck.c @@ -52,7 +52,7 @@ errcode_t e2fsck_reset_context(e2fsck_t ctx) } if (ctx->inode_reg_map) { ext2fs_free_inode_bitmap(ctx->inode_reg_map); - ctx->inode_dir_map = 0; + ctx->inode_reg_map = 0; } if (ctx->block_found_map) { ext2fs_free_block_bitmap(ctx->block_found_map); diff --git a/e2fsck/pass4.c b/e2fsck/pass4.c index 92721bd..ebc6fc4 100644 --- a/e2fsck/pass4.c +++ b/e2fsck/pass4.c @@ -154,8 +154,9 @@ void e2fsck_pass4(e2fsck_t ctx) ext2fs_free_icount(ctx->inode_link_info); ctx->inode_link_info = 0; ext2fs_free_icount(ctx->inode_count); ctx->inode_count = 0; ext2fs_free_inode_bitmap(ctx->inode_bb_map); - ext2fs_free_inode_bitmap(ctx->inode_imagic_map); ctx->inode_bb_map = 0; + ext2fs_free_inode_bitmap(ctx->inode_imagic_map); + ctx->inode_imagic_map = 0; #ifdef RESOURCE_TRACK if (ctx->options & E2F_OPT_TIME2) { e2fsck_clear_progbar(ctx); diff --git a/e2fsck/problem.h b/e2fsck/problem.h index f9ce29e..5d6b6e7 100644 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@ -403,7 +403,7 @@ struct problem_context { #define PR_2_DEALLOC_INODE 0x020023 /* Directory entry for '.' is big. Split? */ -#define PR_2_SPLIT_DOT 0x0200024 +#define PR_2_SPLIT_DOT 0x020024 /* Illegal FIFO */ #define PR_2_BAD_FIFO 0x020025 diff --git a/e2fsck/unix.c b/e2fsck/unix.c index 150bd51..ae5a808 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -832,8 +832,9 @@ restart: print_resource_track(NULL, &ctx->global_rtrack); #endif - e2fsck_free_context(ctx); ext2fs_close(fs); + ctx->fs = NULL; + e2fsck_free_context(ctx); return exit_value; } -- 1.8.3.1