Blame SOURCES/e2fsprogs-1.42.9-dont-require-fsck-for-resize-p.patch

252946
commit 0462fd6db55de28d7e087d8d06ab20339acd8f67
252946
Author: Eric Sandeen <sandeen@sandeen.net>
252946
Date:   Sun Dec 14 19:08:59 2014 -0500
252946
252946
    resize2fs: don't require fsck to print min size
252946
    
252946
    My previous change ended up requiring that the filesystem
252946
    be fsck'd after the last mount, even if we are only querying
252946
    the minimum size.  This is a bit draconian, and it burned
252946
    the Fedora installer, which wants to calculate minimum size
252946
    for every filesystem in the box at install time, which in turn
252946
    requires a full fsck of every filesystem.
252946
    
252946
    Try this one more time, and separate out the tests to make things
252946
    a bit more clear.  If we're only printing the min size, don't
252946
    require the fsck, as this is a bit less dangerous/critical.
252946
    
252946
    Signed-off-by: Eric Sandeen <sandeen@redhat.com>
252946
    Signed-off-by: Theodore Ts'o <tytso@mit.edu>
252946
252946
Index: e2fsprogs-1.42.9/resize/main.c
252946
===================================================================
252946
--- e2fsprogs-1.42.9.orig/resize/main.c
252946
+++ e2fsprogs-1.42.9/resize/main.c
252946
@@ -319,10 +319,30 @@ int main (int argc, char ** argv)
252946
 		exit (1);
252946
 	}
252946
 
252946
-	if (!(mount_flags & EXT2_MF_MOUNTED)) {
252946
-		if (!force && ((fs->super->s_lastcheck < fs->super->s_mtime) ||
252946
-			       (fs->super->s_state & EXT2_ERROR_FS) ||
252946
-			       ((fs->super->s_state & EXT2_VALID_FS) == 0))) {
252946
+	/*
252946
+	 * Before acting on an unmounted filesystem, make sure it's ok,
252946
+	 * unless the user is forcing it.
252946
+	 *
252946
+	 * We do ERROR and VALID checks even if we're only printing the
252946
+	 * minimimum size, because traversal of a badly damaged filesystem
252946
+	 * can cause issues as well.  We don't require it to be fscked after
252946
+	 * the last mount time in this case, though, as this is a bit less
252946
+	 * risky.
252946
+	 */
252946
+	if (!force && !(mount_flags & EXT2_MF_MOUNTED)) {
252946
+		int checkit = 0;
252946
+
252946
+		if (fs->super->s_state & EXT2_ERROR_FS)
252946
+			checkit = 1;
252946
+
252946
+		if ((fs->super->s_state & EXT2_VALID_FS) == 0)
252946
+			checkit = 1;
252946
+
252946
+		if ((fs->super->s_lastcheck < fs->super->s_mtime) &&
252946
+		    !print_min_size)
252946
+			checkit = 1;
252946
+
252946
+		if (checkit) {
252946
 			fprintf(stderr,
252946
 				_("Please run 'e2fsck -f %s' first.\n\n"),
252946
 				device_name);