From 231f091f14b064041c62131e228de02ff249def0 Mon Sep 17 00:00:00 2001 From: girish Date: Mon, 29 Jun 2009 04:34:56 +0000 Subject: [PATCH] b=17569 i=adilger i=johann add check for >8TB filesystems. Don't allo mounting them until force_over_8tb mount option is specified --- .../patches/ext3-force_over_8tb-rhel5.patch | 58 ++++++++++++++++++++++ .../patches/ext3-force_over_8tb-sles10.patch | 58 ++++++++++++++++++++++ .../patches/ext4-force_over_8tb-rhel5.patch | 57 +++++++++++++++++++++ .../patches/ext4-force_over_8tb-sles11.patch | 58 ++++++++++++++++++++++ .../series/ldiskfs-2.6-rhel5-ext4.series | 1 + .../kernel_patches/series/ldiskfs-2.6-rhel5.series | 3 +- .../series/ldiskfs-2.6-sles10.series | 1 + .../series/ldiskfs-2.6-sles11.series | 1 + 8 files changed, 236 insertions(+), 1 deletion(-) create mode 100644 ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch create mode 100644 ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch create mode 100644 ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch create mode 100644 ldiskfs/kernel_patches/patches/ext4-force_over_8tb-sles11.patch diff --git a/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch new file mode 100644 index 0000000..c46c472 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch @@ -0,0 +1,58 @@ +Index: linux-2.6.18-128.1.6/fs/ext3/super.c +=================================================================== +--- linux-2.6.18-128.1.6.orig/fs/ext3/super.c ++++ linux-2.6.18-128.1.6/fs/ext3/super.c +@@ -51,6 +51,8 @@ + #define EXT3_DEFAULT_MAX_DIR_SIZE 0 + #define EXT3_MAX_DIR_SIZE_NAME "max_dir_size" + ++static int force_over_8tb; ++ + static int ext3_load_journal(struct super_block *, struct ext3_super_block *, + unsigned long journal_devnum); + static int ext3_create_journal(struct super_block *, struct ext3_super_block *, +@@ -715,7 +717,7 @@ enum { + Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_grpquota, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, +- Opt_mballoc, Opt_nomballoc, Opt_stripe, ++ Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_force_over_8tb, + }; + + static match_table_t tokens = { +@@ -779,6 +781,7 @@ static match_table_t tokens = { + {Opt_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, + {Opt_stripe, "stripe=%u"}, ++ {Opt_force_over_8tb, "force_over_8tb"}, + {Opt_err, NULL}, + {Opt_resize, "resize"}, + }; +@@ -1157,6 +1160,9 @@ clear_qf_name: + return 0; + sbi->s_stripe = option; + break; ++ case Opt_force_over_8tb: ++ force_over_8tb = 1; ++ break; + default: + printk (KERN_ERR + "EXT3-fs: Unrecognized mount option \"%s\" " +@@ -2248,6 +2254,17 @@ static int ext3_fill_super (struct super + goto failed_mount; + } + ++ if (le32_to_cpu(es->s_blocks_count) > ++ ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) { ++ if (force_over_8tb == 0) { ++ printk(KERN_ERR "EXT3-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 (EXT3_BLOCKS_PER_GROUP(sb) == 0) + goto cantfind_ext3; + sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) - diff --git a/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch new file mode 100644 index 0000000..ff5e907 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-sles10.patch @@ -0,0 +1,58 @@ +Index: linux-2.6.16.60-0.37/fs/ext3/super.c +=================================================================== +--- linux-2.6.16.60-0.37.orig/fs/ext3/super.c ++++ linux-2.6.16.60-0.37/fs/ext3/super.c +@@ -52,6 +52,8 @@ + #define EXT3_DEFAULT_MAX_DIR_SIZE 0 + #define EXT3_MAX_DIR_SIZE_NAME "max_dir_size" + ++static int force_over_8tb; ++ + static int ext3_load_journal(struct super_block *, struct ext3_super_block *, + unsigned long journal_devnum); + static int ext3_create_journal(struct super_block *, struct ext3_super_block *, +@@ -708,7 +710,7 @@ enum { + Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, + Opt_mballoc, Opt_nomballoc, Opt_stripe, +- Opt_grpquota ++ Opt_grpquota, Opt_force_over_8tb + }; + + static match_table_t tokens = { +@@ -771,6 +773,7 @@ static match_table_t tokens = { + {Opt_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, + {Opt_stripe, "stripe=%u"}, ++ {Opt_force_over_8tb, "force_over_8tb"}, + {Opt_err, NULL}, + {Opt_resize, "resize"}, + }; +@@ -1145,6 +1148,9 @@ clear_qf_name: + return 0; + sbi->s_stripe = option; + break; ++ case Opt_force_over_8tb: ++ force_over_8tb = 1; ++ break; + default: + printk (KERN_ERR + "EXT3-fs: Unrecognized mount option \"%s\" " +@@ -2231,6 +2237,17 @@ static int ext3_fill_super (struct super + goto failed_mount; + } + ++ if (le32_to_cpu(es->s_blocks_count) > ++ ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) { ++ if (force_over_8tb == 0) { ++ printk(KERN_ERR "EXT3-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 (EXT3_BLOCKS_PER_GROUP(sb) == 0) + goto cantfind_ext3; + sbi->s_groups_count = (le32_to_cpu(es->s_blocks_count) - diff --git a/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch b/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch new file mode 100644 index 0000000..6529fbc --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-rhel5.patch @@ -0,0 +1,57 @@ +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/patches/ext4-force_over_8tb-sles11.patch b/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-sles11.patch new file mode 100644 index 0000000..1e15050 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext4-force_over_8tb-sles11.patch @@ -0,0 +1,58 @@ +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; + 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 294e9b2..1ac0b51 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5-ext4.series @@ -20,3 +20,4 @@ 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_8tb-rhel5.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series index ae1ad0a..e014f8c 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series @@ -25,4 +25,5 @@ ext3-xattr-no-update-ctime-2.6.22-vanilla.patch ext3-journal-chksum-2.6.18-vanilla.patch ext3-get-raid-stripe-from-sb.patch ext3-big-endian-check-2.6-rhel5.patch -alloc-policy-2.6-rhlel5.diff +alloc-policy-2.6-rhlel5.diff +ext3-force_over_8tb-rhel5.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series index b755452..b526868 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series @@ -31,3 +31,4 @@ ext3-journal-chksum-2.6.18-vanilla.patch ext3-get-raid-stripe-from-sb.patch ext3-big-endian-check-2.6-sles10.patch alloc-policy-2.6-rhlel5.diff +ext3-force_over_8tb-sles10.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series index fdce94b..ad9a0b3 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles11.series @@ -24,3 +24,4 @@ ext4-disable-delalloc-sles11.patch ext4-lustre-i_version.patch ext4-lock-cached_extent.patch ext4-convert-group-lock-sles11.patch +ext4-force_over_8tb-sles11.patch -- 1.8.3.1