From 44a3c0fae6ff69a06cacda455edb7438fdf40cf5 Mon Sep 17 00:00:00 2001 From: girish Date: Wed, 1 Jul 2009 10:07:42 +0000 Subject: [PATCH] b=17569 i=adilger i=johann add check for >8TB filesystem --- .../patches/ext3-force_over_8tb-2.6.22.patch | 58 ++++++++++++++++++++++ .../patches/ext3-force_over_8tb-rhel5.patch | 57 +++++++++++++++++++++ .../patches/ext3-force_over_8tb-sles10.patch | 58 ++++++++++++++++++++++ .../kernel_patches/series/ldiskfs-2.6-rhel5.series | 1 + .../series/ldiskfs-2.6-sles10.series | 1 + .../series/ldiskfs-2.6.22-vanilla.series | 1 + 6 files changed, 176 insertions(+) create mode 100644 ldiskfs/kernel_patches/patches/ext3-force_over_8tb-2.6.22.patch 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 diff --git a/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-2.6.22.patch b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-2.6.22.patch new file mode 100644 index 0000000..27a8d57 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-2.6.22.patch @@ -0,0 +1,58 @@ +Index: linux-2.6.22.14/fs/ext3/super.c +=================================================================== +--- linux-2.6.22.14.orig/fs/ext3/super.c 2009-07-01 14:04:44.000000000 +0530 ++++ linux-2.6.22.14/fs/ext3/super.c 2009-07-01 14:05:33.000000000 +0530 +@@ -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 *, +@@ -711,7 +713,7 @@ + Opt_grpquota, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, + Opt_mballoc, Opt_nomballoc, Opt_stripe, +- Opt_hashfunc, ++ Opt_hashfunc, Opt_force_over_8tb, + }; + + static match_table_t tokens = { +@@ -771,6 +773,7 @@ + {Opt_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, + {Opt_stripe, "stripe=%u"}, ++ {Opt_force_over_8tb, "force_over_8tb"}, + {Opt_err, NULL}, + {Opt_resize, "resize"}, + {Opt_hashfunc,"hash=%s"}, +@@ -1158,6 +1161,9 @@ + return 0; + } + break; ++ case Opt_force_over_8tb: ++ force_over_8tb = 1; ++ break; + default: + printk (KERN_ERR + "EXT3-fs: Unrecognized mount option \"%s\" " +@@ -2254,6 +2260,17 @@ + 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-rhel5.patch b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch new file mode 100644 index 0000000..bf33ca7 --- /dev/null +++ b/ldiskfs/kernel_patches/patches/ext3-force_over_8tb-rhel5.patch @@ -0,0 +1,57 @@ +Index: linux-2.6.18-128.1.6/fs/ext3/super.c +=================================================================== +--- linux-2.6.18-128.1.6.orig/fs/ext3/super.c 2009-07-01 13:55:03.000000000 +0530 ++++ linux-2.6.18-128.1.6/fs/ext3/super.c 2009-07-01 13:56:32.000000000 +0530 +@@ -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 *, +@@ -722,6 +724,7 @@ + Opt_grpquota, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, + Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_hashfunc, ++ Opt_force_over_8tb, + }; + + static match_table_t tokens = { +@@ -785,6 +788,7 @@ + {Opt_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, + {Opt_stripe, "stripe=%u"}, ++ {Opt_force_over_8tb, "force_over_8tb"}, + {Opt_err, NULL}, + {Opt_resize, "resize"}, + {Opt_hashfunc,"hash=%s"}, +@@ -1181,6 +1185,9 @@ + return 0; + } + break; ++ case Opt_force_over_8tb: ++ force_over_8tb = 1; ++ break; + default: + printk (KERN_ERR + "EXT3-fs: Unrecognized mount option \"%s\" " +@@ -2274,6 +2281,17 @@ + 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..5cbaf52 --- /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 2009-07-01 14:00:38.000000000 +0530 ++++ linux-2.6.16.60-0.37/fs/ext3/super.c 2009-07-01 14:03:03.000000000 +0530 +@@ -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 *, +@@ -714,7 +716,7 @@ + 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_hashfunc ++ Opt_grpquota, Opt_hashfunc, Opt_force_over_8tb + }; + + static match_table_t tokens = { +@@ -777,6 +779,7 @@ + {Opt_mballoc, "mballoc"}, + {Opt_nomballoc, "nomballoc"}, + {Opt_stripe, "stripe=%u"}, ++ {Opt_force_over_8tb, "force_over_8tb"}, + {Opt_err, NULL}, + {Opt_resize, "resize"}, + {Opt_hashfunc,"hash=%s"}, +@@ -1169,6 +1172,9 @@ + return 0; + } + break; ++ case Opt_force_over_8tb: ++ force_over_8tb = 1; ++ break; + default: + printk (KERN_ERR + "EXT3-fs: Unrecognized mount option \"%s\" " +@@ -2257,6 +2263,17 @@ + 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/series/ldiskfs-2.6-rhel5.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series index 4949de3..26de1b0 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-rhel5.series @@ -31,3 +31,4 @@ ext3-get-raid-stripe-from-sb.patch ext3-big-endian-check-2.6-rhel5.patch ext3-remove-del_entry-space.patch ext3-osd-iop-common.patch +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 5a179b6..17b45eb7 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6-sles10.series @@ -35,3 +35,4 @@ ext3-fiemap-2.6-sles10.patch ext3-get-raid-stripe-from-sb.patch ext3-big-endian-check-2.6-sles10.patch ext3-osd-iop-common.patch +ext3-force_over_8tb-sles10.patch diff --git a/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series b/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series index 9a37e1f..5bc8857 100644 --- a/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series +++ b/ldiskfs/kernel_patches/series/ldiskfs-2.6.22-vanilla.series @@ -30,3 +30,4 @@ ext3-fiemap-2.6.22-vanilla.patch ext3-get-raid-stripe-from-sb.patch ext3-big-endian-check-2.6.22-vanilla.patch ext3-osd-iop-common.patch +ext3-force_over_8tb-2.6.22.patch -- 1.8.3.1