Index: linux-stage/fs/ext4/super.c =================================================================== --- linux-stage.orig/fs/ext4/super.c 2011-03-11 15:27:08.000000000 +0800 +++ linux-stage/fs/ext4/super.c 2011-03-11 15:29:41.023089829 +0800 @@ -72,6 +72,8 @@ static int ext4_freeze(struct super_block *sb); +static int bigendian_extents; + ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, struct ext4_group_desc *bg) { @@ -1492,7 +1494,7 @@ Opt_stripe, Opt_delalloc, Opt_nodelalloc, Opt_block_validity, Opt_noblock_validity, Opt_inode_readahead_blks, Opt_journal_ioprio, - Opt_mballoc, + Opt_mballoc, Opt_bigendian_extents, Opt_discard, Opt_nodiscard, Opt_init_inode_table, Opt_noinit_inode_table, }; @@ -1559,6 +1561,7 @@ {Opt_auto_da_alloc, "auto_da_alloc=%u"}, {Opt_auto_da_alloc, "auto_da_alloc"}, {Opt_noauto_da_alloc, "noauto_da_alloc"}, + {Opt_bigendian_extents, "bigendian_extents"}, {Opt_mballoc, "mballoc"}, {Opt_discard, "discard"}, {Opt_nodiscard, "nodiscard"}, @@ -1996,6 +1999,9 @@ break; case Opt_mballoc: break; + case Opt_bigendian_extents: + bigendian_extents = 1; + break; case Opt_discard: set_opt(sbi->s_mount_opt, DISCARD); break; @@ -3073,6 +3079,16 @@ goto failed_mount; } +#ifdef __BIG_ENDIAN + if (bigendian_extents == 0) { + printk(KERN_ERR "EXT4-fs: extents feature is not guaranteed to " + "work on big-endian systems. Use \"bigendian_extents\" " + "mount option to override.\n"); + goto failed_mount; + } +#endif + + #ifdef CONFIG_PROC_FS if (ext4_proc_root) sbi->s_proc = proc_mkdir(sb->s_id, ext4_proc_root);