Whamcloud - gitweb
ChangeLog, pass5.c, problem.c, problem.h:
authorTheodore Ts'o <tytso@mit.edu>
Sat, 10 Jun 2000 19:21:33 +0000 (19:21 +0000)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 10 Jun 2000 19:21:33 +0000 (19:21 +0000)
  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.

e2fsck/ChangeLog
e2fsck/pass5.c
e2fsck/problem.c
e2fsck/problem.h

index 048b17c..ebdb269 100644 (file)
@@ -1,3 +1,11 @@
+2000-06-10  Theodore Ts'o  <tytso@valinux.com>
+
+       * 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  <tytso@valinux.com>
 
        * pass1.c (pass1, check_size): Apply patch from Chris Wedgewood
index d074d00..790517d 100644 (file)
@@ -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);
 
index 6766e01..6ddd7aa 100644 (file)
@@ -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 }
 };
 
index a0d067f..ac73db3 100644 (file)
@@ -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
  */