From: Theodore Ts'o Date: Fri, 8 Nov 2002 20:55:17 +0000 (-0500) Subject: unix.c (main): Fix a bug where e2fsck could erroneously mark a X-Git-Tag: E2FSPROGS-1_31~6 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c1637bd371bc4eb387443752a74e68142d609690;p=thirdparty%2Fe2fsprogs.git 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.) --- diff --git a/e2fsck/ChangeLog b/e2fsck/ChangeLog index 9c7a43c07..80daf714a 100644 --- a/e2fsck/ChangeLog +++ b/e2fsck/ChangeLog @@ -1,5 +1,10 @@ 2002-11-08 + * 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 241f048fc..96fe4f386 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);