Index: linux-2.6.27.21-0.1/fs/ext4/super.c =================================================================== --- linux-2.6.27.21-0.1.orig/fs/ext4/super.c +++ linux-2.6.27.21-0.1/fs/ext4/super.c @@ -52,6 +52,8 @@ struct proc_dir_entry *ext4_proc_root; +static int force_over_8tb; + static int ext4_load_journal(struct super_block *, struct ext4_super_block *, unsigned long journal_devnum); static int ext4_create_journal(struct super_block *, struct ext4_super_block *, @@ -1295,7 +1297,7 @@ enum { Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_inode_readahead_blks, Opt_bigendian_extents, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, - Opt_mballoc + Opt_mballoc, Opt_force_over_8tb }; static match_table_t tokens = { @@ -1358,6 +1360,7 @@ static match_table_t tokens = { {Opt_inode_readahead_blks, "inode_readahead_blks=%u"}, {Opt_bigendian_extents, "bigendian_extents"}, {Opt_mballoc, "mballoc"}, + {Opt_force_over_8tb, "force_over_8tb"}, {Opt_err, NULL}, }; @@ -1778,6 +1781,9 @@ set_qf_format: break; case Opt_mballoc: break; + case Opt_force_over_8tb: + force_over_8tb = 1; + break; default: printk(KERN_ERR "EXT4-fs: Unrecognized mount option \"%s\" " @@ -2639,6 +2645,17 @@ static int ext4_fill_super(struct super_ goto failed_mount; } + if (ext4_blocks_count(es) > + ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) { + if (force_over_8tb == 0) { + printk(KERN_ERR "EXT4-fs does not support filesystems " + "greater than 8TB and can cause data corruption." + "Use \"force_over_8tb\" mount option to override." + "\n"); + goto failed_mount; + } + } + if (EXT4_BLOCKS_PER_GROUP(sb) == 0) goto cantfind_ext4;