Whamcloud - gitweb
b=20298 (Merge head ldiskfs and b1_8 ldiskfs)
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-force_over_8tb-rhel5.patch
1 Index: linux-2.6.18-128.1.6/fs/ext3/super.c
2 ===================================================================
3 --- linux-2.6.18-128.1.6.orig/fs/ext3/super.c
4 +++ linux-2.6.18-128.1.6/fs/ext3/super.c
5 @@ -51,6 +51,8 @@
6  #define EXT3_DEFAULT_MAX_DIR_SIZE              0
7  #define EXT3_MAX_DIR_SIZE_NAME         "max_dir_size"
8  
9 +static int force_over_8tb;
10 +
11  static int ext3_load_journal(struct super_block *, struct ext3_super_block *,
12                              unsigned long journal_devnum);
13  static int ext3_create_journal(struct super_block *, struct ext3_super_block *,
14 @@ -715,7 +717,7 @@ enum {
15         Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
16         Opt_grpquota,
17         Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug,
18 -       Opt_mballoc, Opt_nomballoc, Opt_stripe,
19 +       Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_force_over_8tb,
20  };
21  
22  static match_table_t tokens = {
23 @@ -779,6 +781,7 @@ static match_table_t tokens = {
24         {Opt_mballoc, "mballoc"},
25         {Opt_nomballoc, "nomballoc"},
26         {Opt_stripe, "stripe=%u"},
27 +       {Opt_force_over_8tb, "force_over_8tb"},
28         {Opt_err, NULL},
29         {Opt_resize, "resize"},
30  };
31 @@ -1157,6 +1160,9 @@ clear_qf_name:
32                                 return 0;
33                         sbi->s_stripe = option;
34                         break;
35 +               case Opt_force_over_8tb:
36 +                       force_over_8tb = 1;
37 +                       break;
38                 default:
39                         printk (KERN_ERR
40                                 "EXT3-fs: Unrecognized mount option \"%s\" "
41 @@ -2248,6 +2254,17 @@ static int ext3_fill_super (struct super
42                 goto failed_mount;
43         }
44  
45 +       if (le32_to_cpu(es->s_blocks_count) >
46 +           ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) {
47 +               if (force_over_8tb == 0) {
48 +                       printk(KERN_ERR "EXT3-fs does not support filesystems "
49 +                              "greater than 8TB and can cause data corruption."
50 +                              "Use \"force_over_8tb\" mount option to override."
51 +                              "\n");
52 +                       goto failed_mount;
53 +               }
54 +       }
55 +
56         if (EXT3_BLOCKS_PER_GROUP(sb) == 0)
57                 goto cantfind_ext3;
58         sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) -