diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 048b17c5..ebdb2692 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,3 +1,11 @@ +2000-06-10 Theodore Ts'o + + * pass5.c (check_block_bitmaps, check_inode_bitmaps): Add error + checking for a "should never happen case". + + * problem.c, problem.h (PR_5_COPY_IBITMAP_ERROR, + PR_5_COPY_BBITMAP_ERROR): Add new error codes. + 2000-05-27 Theodore Ts'o * pass1.c (pass1, check_size): Apply patch from Chris Wedgewood diff --git a/e2fsck/pass5.c b/e2fsck/pass5.c index d074d002..790517d0 100644 --- a/e2fsck/pass5.c +++ b/e2fsck/pass5.c @@ -175,7 +175,12 @@ redo_counts: ext2fs_free_block_bitmap(fs->block_map); retval = ext2fs_copy_bitmap(ctx->block_found_map, &fs->block_map); - /* XXX check retval --- should never fail! */ + if (retval) { + clear_problem_context(&pctx); + fix_problem(ctx, PR_5_COPY_BBITMAP_ERROR, &pctx); + ctx->flags |= E2F_FLAG_ABORT; + return; + } ext2fs_set_bitmap_padding(fs->block_map); ext2fs_mark_bb_dirty(fs); @@ -324,7 +329,12 @@ do_counts: ext2fs_free_inode_bitmap(fs->inode_map); retval = ext2fs_copy_bitmap(ctx->inode_used_map, &fs->inode_map); - /* XXX check retval --- should never fail! */ + if (retval) { + clear_problem_context(&pctx); + fix_problem(ctx, PR_5_COPY_IBITMAP_ERROR, &pctx); + ctx->flags |= E2F_FLAG_ABORT; + return; + } ext2fs_set_bitmap_padding(fs->inode_map); ext2fs_mark_ib_dirty(fs); diff --git a/e2fsck/problem.c b/e2fsck/problem.c index 6766e019..6ddd7aa8 100644 --- a/e2fsck/problem.c +++ b/e2fsck/problem.c @@ -981,7 +981,17 @@ static const struct e2fsck_problem problem_table[] = { { PR_5_FUDGE_BITMAP_ERROR, N_("Internal error: fudging end of bitmap (%N)\n"), PROMPT_NONE, PR_FATAL }, - + + /* Error copying in replacement inode bitmap */ + { PR_5_COPY_IBITMAP_ERROR, + "Error copying in replacement @i @B: %m\n", + PROMPT_NONE, PR_FATAL }, + + /* Error copying in replacement block bitmap */ + { PR_5_COPY_BBITMAP_ERROR, + "Error copying in replacement @b @B: %m\n", + PROMPT_NONE, PR_FATAL }, + { 0 } }; diff --git a/e2fsck/problem.h b/e2fsck/problem.h index a0d067fc..ac73db31 100644 --- a/e2fsck/problem.h +++ b/e2fsck/problem.h @@ -587,10 +587,16 @@ struct problem_context { /* Programming error: bitmap endpoints don't match */ #define PR_5_BMAP_ENDPOINTS 0x050010 - + /* Internal error: fudging end of bitmap */ #define PR_5_FUDGE_BITMAP_ERROR 0x050011 - + +/* Error copying in replacement inode bitmap */ +#define PR_5_COPY_IBITMAP_ERROR 0x050012 + +/* Error copying in replacement block bitmap */ +#define PR_5_COPY_BBITMAP_ERROR 0x050013 + /* * Function declarations */