-Index: linux-2.6.18-164.6.1/fs/ext4/ext4.h
-===================================================================
---- linux-2.6.18-164.6.1.orig/fs/ext4/ext4.h
-+++ linux-2.6.18-164.6.1/fs/ext4/ext4.h
+diff -up linux-2.6.18-164/fs/ext4/ext4.h linux-2.6.18-164/fs/ext4/ext4.h
+--- linux-2.6.18-164/fs/ext4/ext4.h 2009-10-16 23:26:25.000000000 +0800
++++ linux-2.6.18-164/fs/ext4/ext4.h 2009-10-16 23:31:41.000000000 +0800
@@ -539,6 +539,7 @@ do { \
#define EXT4_MOUNT_QUOTA 0x80000 /* Some quota option set */
#define EXT4_MOUNT_USRQUOTA 0x100000 /* "old" user quota */
#define EXT4_MOUNT_JOURNAL_CHECKSUM 0x800000 /* Journal checksums */
#define EXT4_MOUNT_JOURNAL_ASYNC_COMMIT 0x1000000 /* Journal Async Commit */
#define EXT4_MOUNT_I_VERSION 0x2000000 /* i_version support */
-Index: linux-2.6.18-164.6.1/fs/ext4/ext4_jbd2.h
-===================================================================
---- linux-2.6.18-164.6.1.orig/fs/ext4/ext4_jbd2.h
-+++ linux-2.6.18-164.6.1/fs/ext4/ext4_jbd2.h
+diff -up linux-2.6.18-164/fs/ext4/ext4_jbd2.h linux-2.6.18-164/fs/ext4/ext4_jbd2.h
+--- linux-2.6.18-164/fs/ext4/ext4_jbd2.h 2009-10-16 23:26:25.000000000 +0800
++++ linux-2.6.18-164/fs/ext4/ext4_jbd2.h 2009-10-16 23:32:02.000000000 +0800
@@ -33,7 +33,7 @@
#define EXT4_SINGLEDATA_TRANS_BLOCKS(sb) \
/* Indicate that EXT4_SINGLEDATA_TRANS_BLOCKS takes the sb as argument */
#define EXT4_SINGLEDATA_TRANS_BLOCKS_HAS_SB
-Index: linux-2.6.18-164.6.1/fs/ext4/extents.c
-===================================================================
---- linux-2.6.18-164.6.1.orig/fs/ext4/extents.c
-+++ linux-2.6.18-164.6.1/fs/ext4/extents.c
+diff -up linux-2.6.18-164/fs/ext4/extents.c linux-2.6.18-164/fs/ext4/extents.c
+--- linux-2.6.18-164/fs/ext4/extents.c 2009-10-16 23:26:25.000000000 +0800
++++ linux-2.6.18-164/fs/ext4/extents.c 2009-10-16 23:33:36.000000000 +0800
@@ -2313,7 +2313,7 @@ void ext4_ext_init(struct super_block *s
* possible initialization would be here
*/
return;
#ifdef EXTENTS_STATS
-Index: linux-2.6.18-164.6.1/fs/ext4/ialloc.c
-===================================================================
---- linux-2.6.18-164.6.1.orig/fs/ext4/ialloc.c
-+++ linux-2.6.18-164.6.1/fs/ext4/ialloc.c
+diff -up linux-2.6.18-164/fs/ext4/ialloc.c linux-2.6.18-164/fs/ext4/ialloc.c
+--- linux-2.6.18-164/fs/ext4/ialloc.c 2009-10-16 23:26:25.000000000 +0800
++++ linux-2.6.18-164/fs/ext4/ialloc.c 2009-10-16 23:34:38.000000000 +0800
@@ -938,7 +938,7 @@ got:
if (err)
goto fail_free_drop;
/* set extent flag only for directory, file and normal symlink*/
if (S_ISDIR(mode) || S_ISREG(mode) || S_ISLNK(mode)) {
EXT4_I(inode)->i_flags |= EXT4_EXTENTS_FL;
-Index: linux-2.6.18-164.6.1/fs/ext4/migrate.c
-===================================================================
---- linux-2.6.18-164.6.1.orig/fs/ext4/migrate.c
-+++ linux-2.6.18-164.6.1/fs/ext4/migrate.c
+diff -up linux-2.6.18-164/fs/ext4/migrate.c linux-2.6.18-164/fs/ext4/migrate.c
+--- linux-2.6.18-164/fs/ext4/migrate.c 2009-09-28 16:11:26.000000000 +0800
++++ linux-2.6.18-164/fs/ext4/migrate.c 2009-10-16 23:36:49.000000000 +0800
@@ -459,13 +459,13 @@ int ext4_ext_migrate(struct inode *inode
struct list_blocks_struct lb;
unsigned long max_entries;
return -EINVAL;
if (S_ISLNK(inode->i_mode) && inode->i_blocks == 0)
-Index: linux-2.6.18-164.6.1/fs/ext4/super.c
-===================================================================
---- linux-2.6.18-164.6.1.orig/fs/ext4/super.c
-+++ linux-2.6.18-164.6.1/fs/ext4/super.c
-@@ -844,6 +844,8 @@ static int ext4_show_options(struct seq_
+diff -up linux-2.6.18-164/fs/ext4/super.c linux-2.6.18-164/fs/ext4/super.c
+--- linux-2.6.18-164/fs/ext4/super.c 2009-10-16 23:26:25.000000000 +0800
++++ linux-2.6.18-164/fs/ext4/super.c 2009-10-16 23:48:19.000000000 +0800
+@@ -849,6 +849,8 @@ static int ext4_show_options(struct seq_
seq_puts(seq, ",journal_async_commit");
if (test_opt(sb, NOBH))
seq_puts(seq, ",nobh");
if (test_opt(sb, I_VERSION))
seq_puts(seq, ",i_version");
if (!test_opt(sb, DELALLOC))
-@@ -1346,6 +1348,7 @@ enum {
- Opt_stripe, Opt_delalloc, Opt_nodelalloc,
+@@ -1334,6 +1336,7 @@ enum {
Opt_inode_readahead_blks, Opt_journal_ioprio,
Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_bigendian_extents,
+ Opt_force_over_16tb,
+ Opt_extents, Opt_noextents,
};
static match_table_t tokens = {
-@@ -1413,6 +1416,8 @@ static match_table_t tokens = {
- {Opt_auto_da_alloc, "auto_da_alloc"},
+@@ -1401,6 +1404,8 @@ static match_table_t tokens = {
{Opt_noauto_da_alloc, "noauto_da_alloc"},
{Opt_bigendian_extents, "bigendian_extents"},
+ {Opt_force_over_16tb, "force_over_16tb"},
+ {Opt_extents, "extents"},
+ {Opt_noextents, "noextents"},
{Opt_err, NULL},
};
-@@ -1453,6 +1458,7 @@ static int parse_options(char *options,
+@@ -1441,6 +1446,7 @@ static int parse_options(char *options,
int qtype, qfmt;
char *qname;
#endif
if (!options)
return 1;
-@@ -1840,6 +1846,33 @@ set_qf_format:
- break;
- case Opt_mballoc:
+@@ -1829,6 +1835,33 @@ set_qf_format:
+ case Opt_force_over_16tb:
+ force_over_16tb = 1;
break;
+ case Opt_extents:
+ if (!EXT4_HAS_INCOMPAT_FEATURE(sb,
default:
printk(KERN_ERR
"EXT4-fs: Unrecognized mount option \"%s\" "
-@@ -2513,6 +2546,18 @@ static int ext4_fill_super(struct super_
+@@ -2501,6 +2534,18 @@ static int ext4_fill_super(struct super_
set_opt(sbi->s_mount_opt, BARRIER);
/*
--- /dev/null
+Index: linux-2.6.18-164.6.1/fs/ext4/super.c
+===================================================================
+--- linux-2.6.18-164.6.1.orig/fs/ext4/super.c
++++ linux-2.6.18-164.6.1/fs/ext4/super.c
+@@ -51,6 +51,8 @@
+
+ struct proc_dir_entry *ext4_proc_root;
+
++static int force_over_16tb;
++
+ static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
+ unsigned long journal_devnum);
+ static int ext4_commit_super(struct super_block *sb,
+@@ -1343,6 +1345,7 @@ enum {
+ Opt_stripe, Opt_delalloc, Opt_nodelalloc,
+ Opt_inode_readahead_blks, Opt_journal_ioprio,
+ Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_bigendian_extents,
++ Opt_force_over_16tb,
+ };
+
+ static match_table_t tokens = {
+@@ -1410,6 +1413,7 @@ static match_table_t tokens = {
+ {Opt_auto_da_alloc, "auto_da_alloc"},
+ {Opt_noauto_da_alloc, "noauto_da_alloc"},
+ {Opt_bigendian_extents, "bigendian_extents"},
++ {Opt_force_over_16tb, "force_over_16tb"},
+ {Opt_err, NULL},
+ };
+
+@@ -1837,6 +1841,9 @@ set_qf_format:
+ break;
+ case Opt_mballoc:
+ break;
++ case Opt_force_over_16tb:
++ force_over_16tb = 1;
++ break;
+ default:
+ printk(KERN_ERR
+ "EXT4-fs: Unrecognized mount option \"%s\" "
+@@ -2692,6 +2699,16 @@ static int ext4_fill_super(struct super_
+ goto failed_mount;
+ }
+
++ if (ext4_blocks_count(es) >= (1ULL << 32)) {
++ if (force_over_16tb == 0) {
++ printk(KERN_ERR "EXT4-fs does not support filesystems "
++ "greater than 16TB and can cause data corruption."
++ "Use \"force_over_16tb\" mount option to override."
++ "\n");
++ goto failed_mount;
++ }
++ }
++
+ if (EXT4_BLOCKS_PER_GROUP(sb) == 0)
+ goto cantfind_ext4;
+
+++ /dev/null
-Index: linux-2.6.18-128.1.6/fs/ext4/super.c
-===================================================================
---- linux-2.6.18-128.1.6.orig/fs/ext4/super.c
-+++ linux-2.6.18-128.1.6/fs/ext4/super.c
-@@ -47,6 +47,8 @@
- #include "namei.h"
- #include "group.h"
-
-+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 *,
-@@ -1227,6 +1229,7 @@ enum {
- Opt_grpquota, Opt_extents, Opt_noextents, Opt_i_version,
- Opt_mballoc, Opt_nomballoc, Opt_stripe,
- Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_bigendian_extents,
-+ Opt_force_over_8tb,
- };
-
- static match_table_t tokens = {
-@@ -1289,6 +1292,7 @@ static match_table_t tokens = {
- {Opt_stripe, "stripe=%u"},
- {Opt_resize, "resize"},
- {Opt_bigendian_extents, "bigendian_extents"},
-+ {Opt_force_over_8tb, "force_over_8tb"},
- {Opt_err, NULL},
- };
-
-@@ -1690,6 +1694,9 @@ clear_qf_name:
- case Opt_bigendian_extents:
- bigendian_extents = 1;
- break;
-+ case Opt_force_over_8tb:
-+ force_over_8tb = 1;
-+ break;
- default:
- printk(KERN_ERR
- "EXT4-fs: Unrecognized mount option \"%s\" "
-@@ -2534,6 +2541,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;
-