Commit 62d87796 authored by Linus Torvalds's avatar Linus Torvalds
Browse files

Merge tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4

Pull ext4 fixes from Ted Ts'o:
 "Fix two regressions in ext4, one report by syzkaller[1], and reported
  by multiple users (and tracked by regzbot[2])"

[1] https://syzkaller.appspot.com/bug?extid=4acc7d910e617b360859
[2] https://linux-regtracking.leemhuis.info/regzbot/regression/ZIauBR7YiV3rVAHL@glitch/

* tag 'ext4_for_linus_stable' of git://git.kernel.org/pub/scm/linux/kernel/git/tytso/ext4:
  ext4: drop the call to ext4_error() from ext4_get_group_info()
  Revert "ext4: remove unnecessary check in ext4_bg_num_gdb_nometa"
parents 7a043feb f451fd97
Loading
Loading
Loading
Loading
+13 −12
Original line number Diff line number Diff line
@@ -327,10 +327,8 @@ struct ext4_group_info *ext4_get_group_info(struct super_block *sb,
	struct ext4_group_info **grp_info;
	long indexv, indexh;

	 if (unlikely(group >= EXT4_SB(sb)->s_groups_count)) {
		 ext4_error(sb, "invalid group %u", group);
	if (unlikely(group >= EXT4_SB(sb)->s_groups_count))
		return NULL;
	 }
	indexv = group >> (EXT4_DESC_PER_BLOCK_BITS(sb));
	indexh = group & ((EXT4_DESC_PER_BLOCK(sb)) - 1);
	grp_info = sbi_array_rcu_deref(EXT4_SB(sb), s_group_info, indexv);
@@ -886,6 +884,9 @@ static unsigned long ext4_bg_num_gdb_nometa(struct super_block *sb,
	if (!ext4_bg_has_super(sb, group))
		return 0;

	if (ext4_has_feature_meta_bg(sb))
		return le32_to_cpu(EXT4_SB(sb)->s_es->s_first_meta_bg);
	else
		return EXT4_SB(sb)->s_gdb_count;
}