From a88acda1f1676d1224be86a076bb7e574dbda75d Mon Sep 17 00:00:00 2001 From: Johann Lombardi Date: Fri, 22 Jan 2010 21:49:33 +0100 Subject: [PATCH] b=17569 add force_over_16tb for rhel5/ext4 16TB is the next limit. --- .../patches/ext4-extents-mount-option-rhel5.patch | 62 ++++++++++------------ .../patches/ext4-force_over_16tb-rhel5.patch | 56 +++++++++++++++++++ .../patches/ext4-force_over_8tb-rhel5.patch | 57 -------------------- .../series/ldiskfs-2.6-rhel5-ext4.series | 1 + 4 files changed, 85 insertions(+), 91 deletions(-) create mode 100644 ldiskfs/kernel_patches/patches/ext4-force_over_16tb-rhel5.patch delete mode 100644 ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch diff --git a/ldiskfs/kernel_patches/patches/ext4-extents-mount-option-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-extents-mount-option-rhel5.patch index 762bb33..cb0bcf0 100644 --- a/ldiskfs/kernel_patches/patches/ext4-extents-mount-option-rhel5.patch +++ b/ldiskfs/kernel_patches/patches/ext4-extents-mount-option-rhel5.patch @@ -1,7 +1,6 @@ -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 */ @@ -10,10 +9,9 @@ Index: linux-2.6.18-164.6.1/fs/ext4/ext4.h #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) \ @@ -23,10 +21,9 @@ Index: linux-2.6.18-164.6.1/fs/ext4/ext4_jbd2.h /* 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 */ @@ -45,10 +42,9 @@ Index: linux-2.6.18-164.6.1/fs/ext4/extents.c 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; @@ -58,10 +54,9 @@ Index: linux-2.6.18-164.6.1/fs/ext4/ialloc.c /* 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; @@ -83,11 +78,10 @@ Index: linux-2.6.18-164.6.1/fs/ext4/migrate.c 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"); @@ -96,24 +90,24 @@ Index: linux-2.6.18-164.6.1/fs/ext4/super.c 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 @@ -121,9 +115,9 @@ Index: linux-2.6.18-164.6.1/fs/ext4/super.c 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, @@ -155,7 +149,7 @@ Index: linux-2.6.18-164.6.1/fs/ext4/super.c 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); /* diff --git a/ldiskfs/kernel_patches/patches/ext4-force_over_16tb-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-force_over_16tb-rhel5.patch new file mode 100644 index 0000000..4ea9b247 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext4-force_over_16tb-rhel5.patch @@ -0,0 +1,56 @@ +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; + diff --git a/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch deleted file mode 100644 index 6529fbc..0000000 --- a/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch +++ /dev/null @@ -1,57 +0,0 @@ -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; - diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series index ee73f33..53b761d 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series @@ -18,6 +18,7 @@ ext4-big-endian-check-2.6-rhel5.patch ext4-alloc-policy-2.6-rhel5.patch ext4-misc-rhel5.patch ext4-convert-group-lock-rhel5.patch +ext4-force_over_16tb-rhel5.patch ext4-pdir-fix.patch ext4-osd-iop-common.patch ext4-osd-iam-exports.patch -- 1.8.3.1