Commit ff331054 authored by Dmitry Monakhov's avatar Dmitry Monakhov Committed by Greg Kroah-Hartman

ext4: mark block bitmap corrupted when found instead of BUGON

[ Upstream commit eb576086 ]

We already has similar code in ext4_mb_complex_scan_group(), but
ext4_mb_simple_scan_group() still affected.

Other reports: https://www.spinics.net/lists/linux-ext4/msg60231.htmlReviewed-by: default avatarAndreas Dilger <adilger@dilger.ca>
Signed-off-by: default avatarDmitry Monakhov <dmonakhov@gmail.com>
Link: https://lore.kernel.org/r/20200310150156.641-1-dmonakhov@gmail.comSigned-off-by: default avatarTheodore Ts'o <tytso@mit.edu>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
parent 7fff3f7f
...@@ -1901,8 +1901,15 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac, ...@@ -1901,8 +1901,15 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
BUG_ON(buddy == NULL); BUG_ON(buddy == NULL);
k = mb_find_next_zero_bit(buddy, max, 0); k = mb_find_next_zero_bit(buddy, max, 0);
BUG_ON(k >= max); if (k >= max) {
ext4_grp_locked_error(ac->ac_sb, e4b->bd_group, 0, 0,
"%d free clusters of order %d. But found 0",
grp->bb_counters[i], i);
ext4_mark_group_bitmap_corrupted(ac->ac_sb,
e4b->bd_group,
EXT4_GROUP_INFO_BBITMAP_CORRUPT);
break;
}
ac->ac_found++; ac->ac_found++;
ac->ac_b_ex.fe_len = 1 << i; ac->ac_b_ex.fe_len = 1 << i;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment