2002-11-08 <tytso@snap.thunk.org>
+ * unix.c (main): Fix a bug where e2fsck could erroneously mark a
+ filesystem as being valid if it was being checked and it
+ is interrupted with a ^C. (Bug introduced in e2fsprogs
+ 1.28.)
+
* unix.c (PRS), journal.c: Set the default level of journal
debugging to be 0, and allow the user to set the level of
journal debugging by using the E2FSCK_JBD_DEBUG
exit_value |= FSCK_UNCORRECTED;
exit_value &= ~FSCK_NONDESTRUCT;
}
- if (!(ctx->options & E2F_OPT_READONLY)) {
- if (ext2fs_test_valid(fs)) {
- if (!(sb->s_state & EXT2_VALID_FS))
- exit_value |= FSCK_NONDESTRUCT;
- sb->s_state = EXT2_VALID_FS;
- } else
- sb->s_state &= ~EXT2_VALID_FS;
- sb->s_mnt_count = 0;
- sb->s_lastcheck = time(NULL);
- ext2fs_mark_super_dirty(fs);
- }
if (exit_value & FSCK_CANCELED)
exit_value &= ~FSCK_NONDESTRUCT;
- else
+ else {
show_stats(ctx);
+ if (!(ctx->options & E2F_OPT_READONLY)) {
+ if (ext2fs_test_valid(fs)) {
+ if (!(sb->s_state & EXT2_VALID_FS))
+ exit_value |= FSCK_NONDESTRUCT;
+ sb->s_state = EXT2_VALID_FS;
+ } else
+ sb->s_state &= ~EXT2_VALID_FS;
+ sb->s_mnt_count = 0;
+ sb->s_lastcheck = time(NULL);
+ ext2fs_mark_super_dirty(fs);
+ }
+ }
e2fsck_write_bitmaps(ctx);