Whamcloud - gitweb
Bump version to 1.8.7-wc1 for RC1 and update changelog
[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    2009-07-07 15:00:32.000000000 +0530
4 +++ linux-2.6.27.21-0.1/fs/ext4/super.c 2009-07-07 15:01:30.000000000 +0530
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 @@ -1287,7 +1289,7 @@
15         Opt_inode_readahead_blks, Opt_journal_ioprio,
16         Opt_discard, Opt_nodiscard, Opt_bigendian_extents,
17         Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
18 -       Opt_mballoc, Opt_extents,
19 +       Opt_mballoc, Opt_force_over_8tb, Opt_extents,
20  };
21
22  static match_table_t tokens = {
23 @@ -1349,6 +1351,7 @@
24         {Opt_nodiscard, "nodiscard"},
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 @@ -1773,6 +1776,9 @@
32                         break;
33                 case Opt_mballoc:
34                         break;
35 +               case Opt_force_over_8tb:
36 +                       force_over_8tb = 1;
37 +                       break;
38                 default:
39                         ext4_msg(sb, KERN_ERR,
40                                "Unrecognized mount option \"%s\" "
41 @@ -2634,6 +2640,17 @@
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