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

Submitted by Darrick J. Wong on Oct. 1, 2013, 1:29 a.m.

Details

Message ID 20131001012946.28415.19973.stgit@birch.djwong.org
State Superseded, archived
Headers show

Commit Message

Darrick J. Wong Oct. 1, 2013, 1:29 a.m.
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>
---
 misc/mke2fs.c |   12 ++++++++++++
 1 file changed, 12 insertions(+)



--
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 hide | download patch | download mbox

diff --git a/misc/mke2fs.c b/misc/mke2fs.c
index d8bd5ed..1e44a84 100644
--- a/misc/mke2fs.c
+++ b/misc/mke2fs.c
@@ -2460,6 +2460,18 @@  int main (int argc, char *argv[])
 				 "checksumming.  Pass -O 64bit to rectify.\n"));
 	}
 
+	/* Check the user's mkfs options for 64bit */
+	if (!quiet &&
+	    EXT2_HAS_INCOMPAT_FEATURE(fs->super,
+			EXT4_FEATURE_INCOMPAT_64BIT) &&
+	    !EXT2_HAS_INCOMPAT_FEATURE(fs->super,
+			EXT3_FEATURE_INCOMPAT_EXTENTS)) {
+		printf(_("Extents MUST be enabled for a 64-bit filesystem to "
+			 "be able to access the entire disk space.  Pass "
+			 "-O extents to rectify.\n"));
+		exit(1);
+	}
+
 	/* Calculate journal blocks */
 	if (!journal_device && ((journal_size) ||
 		(fs_param.s_feature_compat &