Whamcloud - gitweb
Branch HEAD
[fs/lustre-release.git] / ldiskfs / kernel_patches / patches / ext3-big-endian-check-2.6-suse.patch
1 Index: linux-2.6.5-7.312/fs/ext3/super.c
2 ===================================================================
3 --- linux-2.6.5-7.312.orig/fs/ext3/super.c
4 +++ linux-2.6.5-7.312/fs/ext3/super.c
5 @@ -84,6 +84,8 @@ handle_t *ext3_journal_start(struct inod
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 @@ -601,7 +603,7 @@ enum {
15         Opt_ignore, Opt_barrier,
16         Opt_err,
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  };
22  
23 @@ -649,6 +651,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 @@ -886,6 +889,9 @@ static int parse_options (char * options
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 @@ -1450,6 +1456,16 @@ static int ext3_fill_super (struct super
42                             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 |= MS_ONE_SECOND;
56         sb->s_flags = (sb->s_flags & ~MS_POSIXACL) |
57                 ((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);