Whamcloud - gitweb
b=22790 strip the .patch off of the dpatch name
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-big-endian-check-2.6.22-vanilla.patch
1 Index: linux-2.6.22.14/fs/ext3/super.c
2 ===================================================================
3 --- linux-2.6.22.14.orig/fs/ext3/super.c
4 +++ linux-2.6.22.14/fs/ext3/super.c
5 @@ -71,6 +71,8 @@ static void ext3_unlockfs(struct super_b
6  static void ext3_write_super (struct super_block * sb);
7  static void ext3_write_super_lockfs(struct super_block *sb);
8  
9 +static int bigendian_extents;
10 +
11  /*
12   * Wrappers for journal_start/end.
13   *
14 @@ -700,7 +702,7 @@ enum {
15         Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
16         Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
17         Opt_grpquota,
18 -       Opt_extents, Opt_noextents, Opt_extdebug,
19 +       Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug,
20         Opt_mballoc, Opt_nomballoc, Opt_stripe,
21  };
22  
23 @@ -756,6 +758,7 @@ static match_table_t tokens = {
24         {Opt_barrier, "barrier=%u"},
25         {Opt_extents, "extents"},
26         {Opt_noextents, "noextents"},
27 +       {Opt_bigendian_extents, "bigendian_extents"},
28         {Opt_extdebug, "extdebug"},
29         {Opt_mballoc, "mballoc"},
30         {Opt_nomballoc, "nomballoc"},
31 @@ -1110,6 +1113,9 @@ clear_qf_name:
32                 case Opt_noextents:
33                         clear_opt (sbi->s_mount_opt, EXTENTS);
34                         break;
35 +               case Opt_bigendian_extents:
36 +                       bigendian_extents = 1;
37 +                       break;
38                 case Opt_extdebug:
39                         set_opt (sbi->s_mount_opt, EXTDEBUG);
40                         break;
41 @@ -2208,6 +2214,15 @@ static int ext3_fill_super (struct super
42                 goto failed_mount;
43         }
44  
45 +#ifdef __BIG_ENDIAN
46 +       if (bigendian_extents == 0) {
47 +               printk(KERN_ERR "EXT3-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         sbi->s_last_alloc_group = -1;