Index: linux-2.6.9-67.0.22/fs/ext3/super.c =================================================================== --- linux-2.6.9-67.0.22.orig/fs/ext3/super.c +++ linux-2.6.9-67.0.22/fs/ext3/super.c @@ -89,6 +89,8 @@ handle_t *ext3_journal_start_sb(struct s return journal_start(journal, nblocks); } +static int bigendian_extents; + /* * The only special thing we need to do here is to make sure that all * journal_stop calls result in the superblock being marked dirty, so @@ -657,7 +659,7 @@ enum { Opt_jqfmt_vfsold, Opt_jqfmt_vfsv0, Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, - Opt_extents, Opt_noextents, Opt_extdebug, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, Opt_mballoc, Opt_nomballoc, Opt_stripe, }; @@ -711,6 +713,7 @@ static match_table_t tokens = { {Opt_iopen_nopriv, "iopen_nopriv"}, {Opt_extents, "extents"}, {Opt_noextents, "noextents"}, + {Opt_bigendian_extents, "bigendian_extents"}, {Opt_extdebug, "extdebug"}, {Opt_barrier, "barrier=%u"}, {Opt_mballoc, "mballoc"}, @@ -1036,6 +1039,9 @@ clear_qf_name: case Opt_noextents: clear_opt (sbi->s_mount_opt, EXTENTS); break; + case Opt_bigendian_extents: + bigendian_extents = 1; + break; case Opt_extdebug: set_opt (sbi->s_mount_opt, EXTDEBUG); break; @@ -1952,6 +1958,16 @@ static int ext3_fill_super (struct super NULL, 0)) goto failed_mount; +#ifdef __BIG_ENDIAN + if (bigendian_extents == 0) { + printk(KERN_ERR "EXT3-fs: e2fsck is not guaranteed to work " + "correctly on the filesystem if EXTENTS feature is " + "used on big-endian systems. Use \"bigendian_extents\" " + "mount option to override.\n"); + goto failed_mount; + } +#endif + set_sb_time_gran(sb, 1000000000U); sb->s_flags = (sb->s_flags & ~MS_POSIXACL) | ((sbi->s_mount_opt & EXT3_MOUNT_POSIX_ACL) ? MS_POSIXACL : 0);