Skip to content

Commit eb57608

Browse files
dmonakhovtytso
authored andcommitted
ext4: mark block bitmap corrupted when found instead of BUGON
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.html Reviewed-by: Andreas Dilger <[email protected]> Signed-off-by: Dmitry Monakhov <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Theodore Ts'o <[email protected]>
1 parent 47b1030 commit eb57608

File tree

1 file changed

+9
-2
lines changed

1 file changed

+9
-2
lines changed

fs/ext4/mballoc.c

Lines changed: 9 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1901,8 +1901,15 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
19011901
BUG_ON(buddy == NULL);
19021902

19031903
k = mb_find_next_zero_bit(buddy, max, 0);
1904-
BUG_ON(k >= max);
1905-
1904+
if (k >= max) {
1905+
ext4_grp_locked_error(ac->ac_sb, e4b->bd_group, 0, 0,
1906+
"%d free clusters of order %d. But found 0",
1907+
grp->bb_counters[i], i);
1908+
ext4_mark_group_bitmap_corrupted(ac->ac_sb,
1909+
e4b->bd_group,
1910+
EXT4_GROUP_INFO_BBITMAP_CORRUPT);
1911+
break;
1912+
}
19061913
ac->ac_found++;
19071914

19081915
ac->ac_b_ex.fe_len = 1 << i;

0 commit comments

Comments
 (0)