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    2011-03-11 15:27:08.000000000 +0800
4 +++ linux-stage/fs/ext4/super.c 2011-03-11 15:29:41.023089829 +0800
5 @@ -72,6 +72,8 @@
6  static int ext4_freeze(struct super_block *sb);
7  
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 @@ -1492,8 +1494,8 @@
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  
24 @@ -1559,6 +1561,7 @@
25         {Opt_auto_da_alloc, "auto_da_alloc=%u"},
26         {Opt_auto_da_alloc, "auto_da_alloc"},
27         {Opt_noauto_da_alloc, "noauto_da_alloc"},
28 +       {Opt_bigendian_extents, "bigendian_extents"},
29         {Opt_mballoc, "mballoc"},
30         {Opt_discard, "discard"},
31         {Opt_nodiscard, "nodiscard"},
32 @@ -1996,6 +1999,9 @@
33                         break;
34                 case Opt_mballoc:
35                         break;
36 +               case Opt_bigendian_extents:
37 +                       bigendian_extents = 1;
38 +                       break;
39                 case Opt_discard:
40                         set_opt(sbi->s_mount_opt, DISCARD);
41                         break;
42 @@ -3073,6 +3079,16 @@
43                 goto failed_mount;
44         }
45  
46 +#ifdef __BIG_ENDIAN
47 +       if (bigendian_extents == 0) {
48 +               printk(KERN_ERR "EXT4-fs: extents feature is not guaranteed to "
49 +                      "work on big-endian systems. Use \"bigendian_extents\" "
50 +                      "mount option to override.\n");
51 +               goto failed_mount;
52 +       }
53 +#endif
54 +
55 +
56  #ifdef CONFIG_PROC_FS
57         if (ext4_proc_root)
58                 sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);