]> git.ipfire.org Git - thirdparty/e2fsprogs.git/commitdiff
unix.c (main): Fix a bug where e2fsck could erroneously mark a
authorTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 20:55:17 +0000 (15:55 -0500)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 8 Nov 2002 20:55:17 +0000 (15:55 -0500)
filesystem as being valid if it was being checked and it
is interrupted with a ^C.  (Bug introduced in e2fsprogs
1.28.)

e2fsck/ChangeLog
e2fsck/unix.c

index 9c7a43c076e086978516d99401a9493aed2bf252..80daf714a424b7af82ebd8db56ac0f6ecde8e815 100644 (file)
@@ -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
index 241f048fc7353c28eba859f5368ff7c945679108..96fe4f386b9ca7307e10d00b437c38d4c042ff31 100644 (file)
@@ -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);