diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index c07289164c12ccb9a87f9ca7ba287feee43e6585..81f9c95a30d6547869481a7b75ffe2d89a5b4b11 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -1803,6 +1803,9 @@ int ext4_mb_try_best_found(struct ext4_allocation_context *ac, return err; ext4_lock_group(ac->ac_sb, group); + if (unlikely(EXT4_MB_GRP_BBITMAP_CORRUPT(e4b->bd_info))) + goto out; + max = mb_find_extent(e4b, ex.fe_start, ex.fe_len, &ex); if (max > 0) { @@ -1810,6 +1813,7 @@ int ext4_mb_try_best_found(struct ext4_allocation_context *ac, ext4_mb_use_best_found(ac, e4b); } +out: ext4_unlock_group(ac->ac_sb, group); ext4_mb_unload_buddy(e4b);