--- a/fs/ext4/super.c +++ b/fs/ext4/super.c @@ -139,6 +139,8 @@ void ext4_kvfree(void *ptr) } +static int bigendian_extents; + ext4_fsblk_t ext4_block_bitmap(struct super_block *sb, struct ext4_group_desc *bg) { @@ -1354,7 +1356,7 @@ enum { Opt_nomblk_io_submit, Opt_block_validity, Opt_noblock_validity, Opt_inode_readahead_blks, Opt_journal_ioprio, Opt_dioread_nolock, Opt_dioread_lock, - Opt_mballoc, + Opt_mballoc, Opt_bigendian_extents, Opt_discard, Opt_nodiscard, Opt_init_itable, Opt_noinit_itable, }; @@ -1429,6 +1431,7 @@ static const match_table_t tokens = { {Opt_noauto_da_alloc, "noauto_da_alloc"}, {Opt_dioread_nolock, "dioread_nolock"}, {Opt_dioread_lock, "dioread_lock"}, + {Opt_bigendian_extents, "bigendian_extents"}, {Opt_mballoc, "mballoc"}, {Opt_discard, "discard"}, {Opt_nodiscard, "nodiscard"}, @@ -1903,6 +1906,9 @@ set_qf_format: else set_opt(sb,NO_AUTO_DA_ALLOC); break; + case Opt_bigendian_extents: + bigendian_extents = 1; + break; case Opt_discard: set_opt(sb, DISCARD); break; @@ -3497,6 +3503,16 @@ static int ext4_fill_super(struct super_ 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);