Whamcloud - gitweb
Branch b1_8
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-big-endian-check-2.6-sles10.patch
1 Index: linux-2.6.16.60-0.27/fs/ext3/super.c
2 ===================================================================
3 --- linux-2.6.16.60-0.27.orig/fs/ext3/super.c
4 +++ linux-2.6.16.60-0.27/fs/ext3/super.c
5 @@ -100,6 +100,8 @@ handle_t *ext3_journal_start_sb(struct s
6         return journal_start(journal, nblocks);
7  }
8  
9 +static int bigendian_extents;
10 +
11  /* 
12   * The only special thing we need to do here is to make sure that all
13   * journal_stop calls result in the superblock being marked dirty, so
14 @@ -703,7 +705,7 @@ enum {
15         Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_quota, Opt_noquota,
16         Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota,
17         Opt_iopen, Opt_noiopen, Opt_iopen_nopriv,
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         Opt_grpquota
22  };
23 @@ -762,6 +764,7 @@ static match_table_t tokens = {
24         {Opt_iopen_nopriv, "iopen_nopriv"},
25         {Opt_extents, "extents"},
26         {Opt_noextents, "noextents"},
27 +       {Opt_bigendian_extents, "bigendian_extents"},
28         {Opt_extdebug, "extdebug"},
29         {Opt_barrier, "barrier=%u"},
30         {Opt_mballoc, "mballoc"},
31 @@ -1122,6 +1125,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 @@ -2052,6 +2058,16 @@ static int ext3_fill_super (struct super
42                             NULL, 0))
43                 goto failed_mount;
44  
45 +#ifdef __BIG_ENDIAN
46 +       if (bigendian_extents == 0) {
47 +               printk(KERN_ERR "EXT3-fs: e2fsck is not guaranteed to work "
48 +                      "correctly on the filesystem if EXTENTS feature is "
49 +                      "used on big-endian systems. Use \"bigendian_extents\" "
50 +                      "mount option to override.\n");
51 +               goto failed_mount;
52 +       }
53 +#endif
54 +
55         sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
56                 ((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);
57