* [PATCH] ext4: mark block bitmap corrupted when found instead of BUGON
@ 2020-03-10 15:01 Dmitry Monakhov
2020-03-10 23:02 ` Andreas Dilger
0 siblings, 1 reply; 3+ messages in thread
From: Dmitry Monakhov @ 2020-03-10 15:01 UTC (permalink / raw)
To: linux-ext4; +Cc: tytso, Dmitry Monakhov
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
Signed-off-by: Dmitry Monakhov <dmonakhov@gmail.com>
---
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 1027e01..97cd1a2 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.7.4
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: mark block bitmap corrupted when found instead of BUGON
2020-03-10 15:01 [PATCH] ext4: mark block bitmap corrupted when found instead of BUGON Dmitry Monakhov
@ 2020-03-10 23:02 ` Andreas Dilger
2020-03-12 14:51 ` Theodore Y. Ts'o
0 siblings, 1 reply; 3+ messages in thread
From: Andreas Dilger @ 2020-03-10 23:02 UTC (permalink / raw)
To: Dmitry Monakhov; +Cc: linux-ext4, Theodore Ts'o
[-- Attachment #1: Type: text/plain, Size: 1245 bytes --]
On Mar 10, 2020, at 9:01 AM, Dmitry Monakhov <dmonakhov@gmail.com> wrote:
>
> 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
>
> Signed-off-by: Dmitry Monakhov <dmonakhov@gmail.com>
Reviewed-by: Andreas Dilger <adilger@dilger.ca>
> ---
> 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 1027e01..97cd1a2 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.7.4
>
Cheers, Andreas
[-- Attachment #2: Message signed with OpenPGP --]
[-- Type: application/pgp-signature, Size: 873 bytes --]
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: [PATCH] ext4: mark block bitmap corrupted when found instead of BUGON
2020-03-10 23:02 ` Andreas Dilger
@ 2020-03-12 14:51 ` Theodore Y. Ts'o
0 siblings, 0 replies; 3+ messages in thread
From: Theodore Y. Ts'o @ 2020-03-12 14:51 UTC (permalink / raw)
To: Andreas Dilger; +Cc: Dmitry Monakhov, linux-ext4
On Tue, Mar 10, 2020 at 05:02:26PM -0600, Andreas Dilger wrote:
> On Mar 10, 2020, at 9:01 AM, Dmitry Monakhov <dmonakhov@gmail.com> wrote:
> >
> > 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
> >
> > Signed-off-by: Dmitry Monakhov <dmonakhov@gmail.com>
>
> Reviewed-by: Andreas Dilger <adilger@dilger.ca>
Thanks, applied.
- Ted
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2020-03-12 14:51 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2020-03-10 15:01 [PATCH] ext4: mark block bitmap corrupted when found instead of BUGON Dmitry Monakhov
2020-03-10 23:02 ` Andreas Dilger
2020-03-12 14:51 ` Theodore Y. Ts'o
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).