Whamcloud - gitweb
e2fsck: Skip journal checks if the fs is mounted and doesn't need recovery
authorTheodore Ts'o <tytso@mit.edu>
Tue, 28 Apr 2009 13:09:44 +0000 (09:09 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Tue, 28 Apr 2009 13:09:44 +0000 (09:09 -0400)
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" <tytso@mit.edu>
e2fsck/unix.c

index c49df23..f452c9c 100644 (file)
@@ -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().