Whamcloud - gitweb
Change mke2fs to refuse to create filesystems greater than 2*31-1 blocks,
authorTheodore Ts'o <tytso@mit.edu>
Fri, 1 Jul 2005 00:00:41 +0000 (20:00 -0400)
committerTheodore Ts'o <tytso@mit.edu>
Fri, 1 Jul 2005 00:00:41 +0000 (20:00 -0400)
at least unless forced.

misc/ChangeLog
misc/mke2fs.c

index 3ad0f53..6a2bd51 100644 (file)
@@ -1,3 +1,9 @@
+2005-06-30  Theodore Ts'o  <tytso@mit.edu>
+
+       * mke2fs.c (PRS): Do not support filesystems with more 2**31-1
+               blocks, since there may be kernel bugs with such
+               filesystems.
+
 2005-06-26  Theodore Ts'o  <tytso@mit.edu>
 
        * tune2fs.8.in: Fix minor typos pointed out by Benno Schulenberg.
index 49689c3..2379ddc 100644 (file)
@@ -1352,6 +1352,13 @@ static void PRS(int argc, char *argv[])
                }
        }
 
+       if (!force && param.s_blocks_count >= (1 << 31)) {
+               com_err(program_name, 0,
+                       _("Filesystem too large.  No more than 2**31-1 blocks\n"
+                         "\t (8TB using a blocksize of 4k) are currently supported."));
+             exit(1);
+       }
+
        if (inode_size) {
                if (inode_size < EXT2_GOOD_OLD_INODE_SIZE ||
                    inode_size > EXT2_BLOCK_SIZE(&param) ||