Whamcloud - gitweb
b=21610 Kernel update for SLES11 SP1.
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext4-big-endian-check-2.6-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
4 +++ linux-2.6.27.21-0.1/fs/ext4/super.c
5 @@ -74,6 +74,8 @@ static void ext4_write_super_lockfs(stru
6  
7  struct proc_dir_entry *proc_root_ext4;
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 @@ -1291,7 +1293,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_discard, Opt_nodiscard,
19 +       Opt_discard, Opt_nodiscard, Opt_bigendian_extents,
20         Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
21  };
22  
23 @@ -1353,6 +1355,7 @@ static const match_table_t tokens = {
24         {Opt_noauto_da_alloc, "noauto_da_alloc"},
25         {Opt_discard, "discard"},
26         {Opt_nodiscard, "nodiscard"},
27 +       {Opt_bigendian_extents, "bigendian_extents"},
28         {Opt_err, NULL},
29  };
30  
31 @@ -1768,6 +1771,9 @@ set_qf_format:
32                 case Opt_nodiscard:
33                         clear_opt(sbi->s_mount_opt, DISCARD);
34                         break;
35 +               case Opt_bigendian_extents:
36 +                       bigendian_extents = 1;
37 +                       break;
38                 default:
39                         ext4_msg(sb, KERN_ERR,
40                                "Unrecognized mount option \"%s\" "
41 @@ -2673,6 +2679,15 @@ static int ext4_fill_super(struct super_
42                                  &sbi->s_inode_readahead_blks);
43  #endif
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         bgl_lock_init(sbi->s_blockgroup_lock);
55  
56         for (i = 0; i < db_count; i++) {