Patchwork [28/31] mke2fs: Complain about creating 64bit filesystems without extents

login
register
mail settings
Submitter Theodore Ts'o
Date Oct. 12, 2013, 1:14 a.m.
Message ID <20131012011456.GB22656@thunk.org>
Download mbox | patch
Permalink /patch/282966/
State Accepted
Headers show

Comments

Theodore Ts'o - Oct. 12, 2013, 1:14 a.m.
On Mon, Sep 30, 2013 at 06:29:46PM -0700, Darrick J. Wong wrote:
> A 64bit filesystem without extents is not terribly useful, because the old
> block map format does not support pointing to high block numbers.  Warn the
> user who tries to create such an animal.
> 
> Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>

I moved the check to the PRS() function, which is where the rest of
the feature flag sanity checks are done.  I also removed the !quiet
check, since we aren't doing this for any of the other sanity checks.
I also shortened the error message so that it fits on an 80 column
screen.

						- Ted

commit 51a72e0161c826670e6ee66cb51c2620402098f8
Author: Darrick J. Wong <darrick.wong@oracle.com>
Date:   Mon Sep 30 18:29:46 2013 -0700

    mke2fs: complain about creating 64bit filesystems without extents
    
    A 64bit filesystem without extents is not terribly useful, because the
    old block map format does not support pointing to high block numbers.
    Warn the user who tries to create such an animal.
    
    Signed-off-by: Darrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: "Theodore Ts'o" <tytso@mit.edu>

--
To unsubscribe from this list: send the line "unsubscribe linux-ext4" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index 22c2815..cc06a97 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -1806,6 +1806,14 @@  profile_error:
 		exit(1);
 	}
 
+	/* Check the user's mkfs options for 64bit */
+	if ((fs_param.s_feature_incompat & EXT4_FEATURE_INCOMPAT_64BIT) &&
+	    !(fs_param.s_feature_incompat & EXT3_FEATURE_INCOMPAT_EXTENTS)) {
+		printf(_("Extents MUST be enabled for a 64-bit filesystem.  "
+			 "Pass -O extents to rectify.\n"));
+		exit(1);
+	}
+
 	/* Set first meta blockgroup via an environment variable */
 	/* (this is mostly for debugging purposes) */
 	if ((fs_param.s_feature_incompat & EXT2_FEATURE_INCOMPAT_META_BG) &&