Whamcloud - gitweb
When testing a disk using e2fsck -c, use the list
authorTheodore Ts'o <tytso@mit.edu>
Tue, 2 Dec 2003 12:56:42 +0000 (07:56 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 2 Dec 2003 12:56:42 +0000 (07:56 -0500)
of new bad blocks to replace the current list of bad
blocks.  This way "e2fsck -c" can be used to recover from
a corrupted bad block inode.

e2fsck/ChangeLog
e2fsck/badblocks.c
e2fsck/e2fsck.h
e2fsck/unix.c

index 31c9001..5c9427b 100644 (file)
@@ -1,3 +1,14 @@
+2003-12-02  Theodore Ts'o  <tytso@mit.edu>
+
+       * unix.c (main): When testing a disk using e2fsck -c, use the list
+               of new bad blocks to replace the current list of bad
+               blocks.  This way "e2fsck -c" can be used to recover from
+               a corrupted bad block inode.
+
+       * badblocks.c (test_disk): Remove the test_disk() file; e2fsck
+               will just call read_bad_blocks_file() directly with the
+               file parameter set to NULL.
+
 2003-09-14  Theodore Ts'o  <tytso@mit.edu>
 
        * unix.c (is_on_batt, check_if_skip): If running on battery, then
index 92aa3c1..572af20 100644 (file)
@@ -113,11 +113,6 @@ fatal:
        
 }
 
-void test_disk(e2fsck_t ctx)
-{
-       read_bad_blocks_file(ctx, 0, 0);
-}
-
 static int check_bb_inode_blocks(ext2_filsys fs, blk_t *block_nr, int blockcnt,
                                 void *priv_data)
 {
index 779835c..695f463 100644 (file)
@@ -359,7 +359,6 @@ extern int e2fsck_run(e2fsck_t ctx);
 /* badblock.c */
 extern void read_bad_blocks_file(e2fsck_t ctx, const char *bad_blocks_file,
                                 int replace_bad_blocks);
-extern void test_disk(e2fsck_t ctx);
 
 /* dirinfo.c */
 extern void e2fsck_add_dir_info(e2fsck_t ctx, ext2_ino_t ino, ext2_ino_t parent);
index c61f3e4..91511bf 100644 (file)
@@ -1034,7 +1034,7 @@ restart:
        if (bad_blocks_file)
                read_bad_blocks_file(ctx, bad_blocks_file, replace_bad_blocks);
        else if (cflag)
-               test_disk(ctx);
+               read_bad_blocks_file(ctx, 0, 1); /* Test disk */
        if (ctx->flags & E2F_FLAG_SIGNAL_MASK)
                fatal_error(ctx, 0);
 #ifdef ENABLE_SWAPFS