Whamcloud - gitweb
LU-136 change "force_over_16tb" mount option to "force_over_128tb"
[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, Opt_maxdirsize
19 +       Opt_mballoc, Opt_nomballoc, Opt_stripe, Opt_maxdirsize, Opt_force_over_8tb,
20  };
21  
22  static match_table_t tokens = {
23 @@ -779,5 +781,6 @@ 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_resize, "resize"},
29  };
30 @@ -1157,6 +1160,9 @@ clear_qf_name:
31                                 return 0;
32                         sbi->s_max_dir_size = option;
33                         break;
34 +               case Opt_force_over_8tb:
35 +                       force_over_8tb = 1;
36 +                       break;
37                 default:
38                         printk (KERN_ERR
39                                 "EXT3-fs: Unrecognized mount option \"%s\" "
40 @@ -2248,6 +2254,17 @@ static int ext3_fill_super (struct super
41                 goto failed_mount;
42         }
43  
44 +       if (le32_to_cpu(es->s_blocks_count) >
45 +           ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) {
46 +               if (force_over_8tb == 0) {
47 +                       printk(KERN_ERR "EXT3-fs does not support filesystems "
48 +                              "greater than 8TB and can cause data corruption."
49 +                              "Use \"force_over_8tb\" mount option to override."
50 +                              "\n");
51 +                       goto failed_mount;
52 +               }
53 +       }
54 +
55         if (EXT3_BLOCKS_PER_GROUP(sb) == 0)
56                 goto cantfind_ext3;
57         sbi->s_groups_count = ((le32_to_cpu(es->s_blocks_count) -