From: Theodore Ts'o Date: Tue, 28 Apr 2009 13:09:44 +0000 (-0400) Subject: e2fsck: Skip journal checks if the fs is mounted and doesn't need recovery X-Git-Tag: v1.41.6~37 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=47c1b8e16668daa6e74cee3c7b8bdf237ffefe70;p=thirdparty%2Fe2fsprogs.git e2fsck: Skip journal checks if the fs is mounted and doesn't need recovery If we are checking a mounted filesystem (typically the root filesystem, mounted read/only) and the NEEDS_RECOVERY flag is not set, skip all of the checks associated with making sure the journal is consistent. There is the very slight possibility we could lose if the NEEDS_RECOVERY flag was somehow cleared even though there was data in the journal, but this has practically never happend in practice, and it reduces the number of reads required at boot-time, which is a big deal when trying to reduce boot times with HDD's. Signed-off-by: "Theodore Ts'o" --- diff --git a/e2fsck/unix.c b/e2fsck/unix.c index c49df23d2..f452c9c28 100644 --- a/e2fsck/unix.c +++ b/e2fsck/unix.c @@ -1138,6 +1138,10 @@ restart: if (isspace(*cp) || *cp == ':') *cp = '_'; + if ((ctx->mount_flags & EXT2_MF_MOUNTED) && + !(sb->s_feature_incompat & EXT3_FEATURE_INCOMPAT_RECOVER)) + goto skip_journal; + /* * Make sure the ext3 superblock fields are consistent. */ @@ -1185,6 +1189,7 @@ restart: } } +skip_journal: /* * Check for compatibility with the feature sets. We need to * be more stringent than ext2fs_open().