Whamcloud - gitweb
LU-2658 llite: too many arguments in generic_file_llseek_size
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext4-force_over_128tb-rhel6.patch
1 Index: linux-stage/fs/ext4/super.c
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/super.c    2011-03-11 15:35:15.680343230 +0800
4 +++ linux-stage/fs/ext4/super.c 2011-03-11 15:44:45.037632078 +0800
5 @@ -55,6 +55,8 @@
6  struct proc_dir_entry *ext4_proc_root;
7  static struct kset *ext4_kset;
8  
9 +static int force_over_128tb;
10 +
11  static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
12                              unsigned long journal_devnum);
13  static int ext4_commit_super(struct super_block *sb, int sync);
14 @@ -1494,7 +1496,7 @@
15         Opt_stripe, Opt_delalloc, Opt_nodelalloc,
16         Opt_block_validity, Opt_noblock_validity,
17         Opt_inode_readahead_blks, Opt_journal_ioprio,
18 -       Opt_mballoc, Opt_bigendian_extents,
19 +       Opt_mballoc, Opt_bigendian_extents, Opt_force_over_128tb,
20         Opt_discard, Opt_nodiscard,
21         Opt_init_inode_table, Opt_noinit_inode_table,
22  };
23 @@ -1562,6 +1564,7 @@
24         {Opt_auto_da_alloc, "auto_da_alloc"},
25         {Opt_noauto_da_alloc, "noauto_da_alloc"},
26         {Opt_bigendian_extents, "bigendian_extents"},
27 +       {Opt_force_over_128tb, "force_over_128tb"},
28         {Opt_mballoc, "mballoc"},
29         {Opt_discard, "discard"},
30         {Opt_nodiscard, "nodiscard"},
31 @@ -2008,6 +2011,9 @@
32                         break;
33                 case Opt_mballoc:
34                         break;
35 +               case Opt_force_over_128tb:
36 +                       force_over_128tb = 1;
37 +                       break;
38                 default:
39                         ext4_msg(sb, KERN_ERR,
40                                "Unrecognized mount option \"%s\" "
41 @@ -3031,6 +3037,16 @@
42                 goto failed_mount;
43         }
44  
45 +       if (ext4_blocks_count(es) > (8ULL << 32)) {
46 +               if (force_over_128tb == 0) {
47 +                       printk(KERN_ERR "EXT4-fs does not support filesystems "
48 +                              "greater than 128TB and can cause data corruption."
49 +                              "Use \"force_over_128tb\" mount option to override."
50 +                              "\n");
51 +                       goto failed_mount;
52 +               }
53 +       }
54 +
55         if (EXT4_BLOCKS_PER_GROUP(sb) == 0)
56                 goto cantfind_ext4;
57