Whamcloud - gitweb
LU-781 kernel: kernel update [RHEL6.2 2.6.32-220]
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext4-big-endian-check-2.6-rhel6.patch
1 Index: linux-stage/fs/ext4/super.c
2 ===================================================================
3 --- linux-stage.orig/fs/ext4/super.c
4 +++ linux-stage/fs/ext4/super.c
5 @@ -82,6 +82,8 @@ static void ext4_clear_request_list(void
6  
7  wait_queue_head_t aio_wq[WQ_HASH_SZ];
8  
9 +static int bigendian_extents;
10 +
11  ext4_fsblk_t ext4_block_bitmap(struct super_block *sb,
12                                struct ext4_group_desc *bg)
13  {
14 @@ -1178,7 +1180,7 @@ enum {
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,
19 +       Opt_mballoc, Opt_bigendian_extents,
20         Opt_discard, Opt_nodiscard,
21         Opt_init_inode_table, Opt_noinit_inode_table,
22  };
23 @@ -1250,6 +1252,7 @@ static const match_table_t tokens = {
24         {Opt_auto_da_alloc, "auto_da_alloc=%u"},
25         {Opt_auto_da_alloc, "auto_da_alloc"},
26         {Opt_noauto_da_alloc, "noauto_da_alloc"},
27 +       {Opt_bigendian_extents, "bigendian_extents"},
28         {Opt_mballoc, "mballoc"},
29         {Opt_discard, "discard"},
30         {Opt_nodiscard, "nodiscard"},
31 @@ -1692,6 +1695,9 @@ set_qf_format:
32                         else
33                                 set_opt(sbi->s_mount_opt,NO_AUTO_DA_ALLOC);
34                         break;
35 +               case Opt_bigendian_extents:
36 +                       bigendian_extents = 1;
37 +                       break;
38                 case Opt_discard:
39                         set_opt(sbi->s_mount_opt, DISCARD);
40                         break;
41 @@ -3179,6 +3185,16 @@ static int ext4_fill_super(struct super_
42                 goto failed_mount;
43         }
44  
45 +#ifdef __BIG_ENDIAN
46 +       if (bigendian_extents == 0) {
47 +               printk(KERN_ERR "EXT4-fs: extents feature is not guaranteed to "
48 +                      "work on big-endian systems. Use \"bigendian_extents\" "
49 +                      "mount option to override.\n");
50 +               goto failed_mount;
51 +       }
52 +#endif
53 +
54 +
55  #ifdef CONFIG_PROC_FS
56         if (ext4_proc_root)
57                 sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);