Whamcloud - gitweb
b=17569
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext4-force_over_8tb-sles11.patch
1 Index: linux-2.6.27.21-0.1/fs/ext4/super.c
2 ===================================================================
3 --- linux-2.6.27.21-0.1.orig/fs/ext4/super.c
4 +++ linux-2.6.27.21-0.1/fs/ext4/super.c
5 @@ -52,6 +52,8 @@
6  
7  struct proc_dir_entry *ext4_proc_root;
8  
9 +static int force_over_8tb;
10 +
11  static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
12                              unsigned long journal_devnum);
13  static int ext4_create_journal(struct super_block *, struct ext4_super_block *,
14 @@ -1295,7 +1297,7 @@ enum {
15         Opt_stripe, Opt_delalloc, Opt_nodelalloc,
16         Opt_inode_readahead_blks, Opt_bigendian_extents,
17         Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
18 -       Opt_mballoc
19 +       Opt_mballoc, Opt_force_over_8tb
20  };
21  
22  static match_table_t tokens = {
23 @@ -1358,6 +1360,7 @@ static match_table_t tokens = {
24         {Opt_inode_readahead_blks, "inode_readahead_blks=%u"},
25         {Opt_bigendian_extents, "bigendian_extents"},
26         {Opt_mballoc, "mballoc"},
27 +       {Opt_force_over_8tb, "force_over_8tb"},
28         {Opt_err, NULL},
29  };
30  
31 @@ -1778,6 +1781,9 @@ set_qf_format:
32                         break;
33                 case Opt_mballoc:
34                         break;
35 +               case Opt_force_over_8tb:
36 +                       force_over_8tb = 1;
37 +                       break;
38                 default:
39                         printk(KERN_ERR
40                                "EXT4-fs: Unrecognized mount option \"%s\" "
41 @@ -2639,6 +2645,17 @@ static int ext4_fill_super(struct super_
42                 goto failed_mount;
43         }
44  
45 +       if (ext4_blocks_count(es) >
46 +           ((0x80000000000ULL >> sb->s_blocksize_bits) - 1)) {
47 +               if (force_over_8tb == 0) {
48 +                       printk(KERN_ERR "EXT4-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 (EXT4_BLOCKS_PER_GROUP(sb) == 0)
57                 goto cantfind_ext4;
58