Index: linux-2.6.22.14/fs/ext3/super.c =================================================================== --- linux-2.6.22.14.orig/fs/ext3/super.c +++ linux-2.6.22.14/fs/ext3/super.c @@ -71,6 +71,8 @@ static void ext3_unlockfs(struct super_b static void ext3_write_super (struct super_block * sb); static void ext3_write_super_lockfs(struct super_block *sb); +static int bigendian_extents; + /* * Wrappers for journal_start/end. * @@ -700,7 +702,7 @@ enum { Opt_ignore, Opt_barrier, Opt_err, Opt_resize, Opt_usrquota, Opt_iopen, Opt_noiopen, Opt_iopen_nopriv, Opt_grpquota, - Opt_extents, Opt_noextents, Opt_extdebug, + Opt_extents, Opt_noextents, Opt_bigendian_extents, Opt_extdebug, Opt_mballoc, Opt_nomballoc, Opt_stripe, }; @@ -756,6 +758,7 @@ static match_table_t tokens = { {Opt_barrier, "barrier=%u"}, {Opt_extents, "extents"}, {Opt_noextents, "noextents"}, + {Opt_bigendian_extents, "bigendian_extents"}, {Opt_extdebug, "extdebug"}, {Opt_mballoc, "mballoc"}, {Opt_nomballoc, "nomballoc"}, @@ -1110,6 +1113,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; @@ -2208,6 +2214,15 @@ static int ext3_fill_super (struct super goto failed_mount; } +#ifdef __BIG_ENDIAN + if (bigendian_extents == 0) { + printk(KERN_ERR "EXT3-fs: extents feature is not guaranteed to " + "work on big-endian systems. Use \"bigendian_extents\" " + "mount option to override.\n"); + goto failed_mount; + } +#endif + bgl_lock_init(&sbi->s_blockgroup_lock); sbi->s_last_alloc_group = -1;