From 47c1b8e16668daa6e74cee3c7b8bdf237ffefe70 Mon Sep 17 00:00:00 2001 From: Theodore Ts'o Date: Tue, 28 Apr 2009 09:09:44 -0400 Subject: [PATCH] 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" --- e2fsck/unix.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/e2fsck/unix.c b/e2fsck/unix.c index c49df23..f452c9c 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(). -- 1.8.3.1