diff --git a/fs/ext4/ialloc.c b/fs/ext4/ialloc.c index e6520627a84a4..e45398c323ee7 100644 --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -513,7 +513,7 @@ static int find_group_orlov(struct super_block *sb, struct inode *parent, goto fallback; } - max_dirs = ndirs / ngroups + inodes_per_group / 16; + max_dirs = ndirs / ngroups + inodes_per_group*flex_size / 16; min_inodes = avefreei - inodes_per_group*flex_size / 4; if (min_inodes < 1) min_inodes = 1;