Whamcloud - gitweb
LU-4708 ldiskfs: do not copy NUL terminator from direntry
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles11sp2 / ext4-force_over_128tb.patch
1 diff -r -u linux-stage.orig/fs/ext4/super.c linux-stage/fs/ext4/super.c
2 --- linux-stage.orig/fs/ext4/super.c    2012-12-31 12:55:18.000000000 -0500
3 +++ linux-stage/fs/ext4/super.c 2012-12-31 12:56:14.000000000 -0500
4 @@ -59,6 +59,8 @@
5  static struct mutex ext4_li_mtx;
6  static struct ext4_features *ext4_feat;
7
8 +static int force_over_128tb;
9 +
10  static int ext4_load_journal(struct super_block *, struct ext4_super_block *,
11                              unsigned long journal_devnum);
12  static int ext4_commit_super(struct super_block *sb, int sync);
13 @@ -1298,7 +1300,7 @@
14         Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity,
15         Opt_inode_readahead_blks, Opt_journal_ioprio,
16         Opt_dioread_nolock, Opt_dioread_lock,
17 -       Opt_mballoc, Opt_bigendian_extents,
18 +       Opt_mballoc, Opt_bigendian_extents, Opt_force_over_128tb,
19         Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
20  };
21
22 @@ -1374,6 +1376,7 @@
23         {Opt_dioread_nolock, "dioread_nolock"},
24         {Opt_dioread_lock, "dioread_lock"},
25         {Opt_bigendian_extents, "bigendian_extents"},
26 +       {Opt_force_over_128tb, "force_over_128tb"},
27         {Opt_mballoc, "mballoc"},
28         {Opt_discard, "discard"},
29         {Opt_nodiscard, "nodiscard"},
30 @@ -1879,6 +1882,9 @@
31                         break;
32                 case Opt_mballoc:
33                         break;
34 +               case Opt_force_over_128tb:
35 +                       force_over_128tb = 1;
36 +                       break;
37                 default:
38                         ext4_msg(sb, KERN_ERR,
39                                "Unrecognized mount option \"%s\" "
40 @@ -3394,6 +3400,16 @@
41                 goto failed_mount;
42         }
43
44 +       if (ext4_blocks_count(es) > (8ULL << 32)) {
45 +               if (force_over_128tb == 0) {
46 +                       printk(KERN_ERR "EXT4-fs does not support filesystems "
47 +                              "greater than 128TB and can cause data corruption."
48 +                              "Use \"force_over_128tb\" mount option to override."
49 +                              "\n");
50 +                       goto failed_mount;
51 +               }
52 +       }
53 +
54         if (EXT4_BLOCKS_PER_GROUP(sb) == 0)
55                 goto cantfind_ext4;
56