Whamcloud - gitweb
LU-4708 ldiskfs: do not copy NUL terminator from direntry
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / sles11sp2 / ext4-big-endian-check-3.0.patch
1 --- a/fs/ext4/super.c
2 +++ b/fs/ext4/super.c
3 @@ -139,6 +139,8 @@ void ext4_kvfree(void *ptr)
4  
5  }
6  
7 +static int bigendian_extents;
8 +
9  ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
10                                struct ext4_group_desc *bg)
11  {
12 @@ -1354,7 +1356,7 @@ enum {
13         Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity,
14         Opt_inode_readahead_blks, Opt_journal_ioprio,
15         Opt_dioread_nolock, Opt_dioread_lock,
16 -       Opt_mballoc,
17 +       Opt_mballoc, Opt_bigendian_extents,
18         Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable,
19  };
20  
21 @@ -1429,6 +1431,7 @@ static const match_table_t tokens = {
22         {Opt_noauto_da_alloc, "noauto_da_alloc"},
23         {Opt_dioread_nolock, "dioread_nolock"},
24         {Opt_dioread_lock, "dioread_lock"},
25 +       {Opt_bigendian_extents, "bigendian_extents"},
26         {Opt_mballoc, "mballoc"},
27         {Opt_discard, "discard"},
28         {Opt_nodiscard, "nodiscard"},
29 @@ -1903,6 +1906,9 @@ set_qf_format:
30                         else
31                                 set_opt(sb,NO_AUTO_DA_ALLOC);
32                         break;
33 +               case Opt_bigendian_extents:
34 +                       bigendian_extents = 1;
35 +                       break;
36                 case Opt_discard:
37                         set_opt(sb, DISCARD);
38                         break;
39 @@ -3497,6 +3503,16 @@ static int ext4_fill_super(struct super_
40                 goto failed_mount;
41         }
42  
43 +#ifdef __BIG_ENDIAN
44 +       if (bigendian_extents == 0) {
45 +               printk(KERN_ERR "EXT4-fs: extents feature is not guaranteed to "
46 +                      "work on big-endian systems. Use \"bigendian_extents\" "
47 +                      "mount option to override.\n");
48 +               goto failed_mount;
49 +       }
50 +#endif
51 +
52 +
53  #ifdef CONFIG_PROC_FS
54         if (ext4_proc_root)
55                 sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);