[<prev] [next>] [day] [month] [year] [list]
Message-Id: <20200918020802.2065198-108-sashal@kernel.org>
Date: Thu, 17 Sep 2020 22:06:24 -0400
From: Sasha Levin <sashal@...nel.org>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
Cc: Dmitry Monakhov <dmonakhov@...il.com>,
Andreas Dilger <adilger@...ger.ca>,
Theodore Ts'o <tytso@....edu>, Sasha Levin <sashal@...nel.org>,
linux-ext4@...r.kernel.org
Subject: [PATCH AUTOSEL 4.19 108/206] ext4: mark block bitmap corrupted when found instead of BUGON
From: Dmitry Monakhov <dmonakhov@...il.com>
[ Upstream commit eb5760863fc28feab28b567ddcda7e667e638da0 ]
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 <adilger@...ger.ca>
Signed-off-by: Dmitry Monakhov <dmonakhov@...il.com>
Link: https://lore.kernel.org/r/20200310150156.641-1-dmonakhov@gmail.com
Signed-off-by: Theodore Ts'o <tytso@....edu>
Signed-off-by: Sasha Levin <sashal@...nel.org>
---
fs/ext4/mballoc.c | 11 +++++++++--
1 file changed, 9 insertions(+), 2 deletions(-)
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 8dd54a8a03610..054cfdd007d69 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -1901,8 +1901,15 @@ void ext4_mb_simple_scan_group(struct ext4_allocation_context *ac,
BUG_ON(buddy == NULL);
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_b_ex.fe_len = 1 << i;
--
2.25.1
Powered by blists - more mailing lists