summaryrefslogtreecommitdiff
path: root/e2fsck
diff options
context:
space:
mode:
authorTheodore Ts'o <tytso@mit.edu>2002-11-08 15:55:17 -0500
committerTheodore Ts'o <tytso@mit.edu>2002-11-08 15:55:17 -0500
commitc1637bd371bc4eb387443752a74e68142d609690 (patch)
treef1a7869def4da1d7a15506144514acc85dc4fa22 /e2fsck
parent5e72cdbeb9cfe32ddff1293cc672dcf66f4f2d5b (diff)
downloade2fsprogs-c1637bd371bc4eb387443752a74e68142d609690.tar.gz
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.)
Diffstat (limited to 'e2fsck')
-rw-r--r--e2fsck/ChangeLog5
-rw-r--r--e2fsck/unix.c25
2 files changed, 18 insertions, 12 deletions
diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog
index 9c7a43c0..80daf714 100644
--- a/e2fsck/ChangeLog
+++ b/e2fsck/ChangeLog
@@ -1,5 +1,10 @@
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
diff --git a/e2fsck/unix.c b/e2fsck/unix.c
index 241f048f..96fe4f38 100644
--- a/e2fsck/unix.c
+++ b/e2fsck/unix.c
@@ -1073,21 +1073,22 @@ restart:
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);