diff --git a/fs/ext4/balloc.c b/fs/ext4/balloc.c index 78ee3ef795ae..1175750ad05f 100644 --- a/fs/ext4/balloc.c +++ b/fs/ext4/balloc.c @@ -56,6 +56,9 @@ void ext4_get_group_no_and_offset(struct super_block *sb, ext4_fsblk_t blocknr, struct ext4_super_block *es = EXT4_SB(sb)->s_es; ext4_grpblk_t offset; + if (blocknr < le32_to_cpu(es->s_first_data_block)) + blocknr = le32_to_cpu(es->s_first_data_block); + blocknr = blocknr - le32_to_cpu(es->s_first_data_block); offset = do_div(blocknr, EXT4_BLOCKS_PER_GROUP(sb)) >> EXT4_SB(sb)->s_cluster_bits;