Whamcloud - gitweb
ehandler.c (e2fsck_handle_read_error): If the user asks to
authorTheodore Ts'o <tytso@mit.edu>
Sat, 31 Aug 2002 06:35:35 +0000 (02:35 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Sat, 31 Aug 2002 06:35:35 +0000 (02:35 -0400)
ignore the error, offer to try forcing a write of the
block to the disk; sometimes this will cause the drive to
remap the bad block.

e2fsck/ChangeLog
e2fsck/ehandler.c

index 14733dc..5eead5c 100644 (file)
@@ -1,3 +1,10 @@
+2002-08-31  Theodore Ts'o  <tytso@mit.edu>
+
+       * ehandler.c (e2fsck_handle_read_error): If the user asks to
+               ignore the error, offer to try forcing a write of the
+               block to the disk; sometimes this will cause the drive to
+               remap the bad block.
+
 2002-08-31  Theodore Ts'o  <tytso@valinux.com>
 
        * pass2.c (e2fsck_pass2): If this is a HTREE directory, sort the
index bd1643e..d4060c4 100644 (file)
@@ -56,8 +56,11 @@ static errcode_t e2fsck_handle_read_error(io_channel channel,
                printf(_("Error reading block %lu (%s).  "), block,
                       error_message(error));
        preenhalt(ctx);
-       if (ask(ctx, _("Ignore error"), 1))
+       if (ask(ctx, _("Ignore error"), 1)) {
+               if (ask(ctx, _("Force rewrite"), 1))
+                       io_channel_write_blk(channel, block, 1, data);
                return 0;
+       }
 
        return error;
 }