Unverified Commit ae70d541 authored by openeuler-ci-bot's avatar openeuler-ci-bot Committed by Gitee
Browse files

!5778 ext4: avoid allocating blocks from corrupted group in ext4_mb_try_best_found()

parents d6b591a9 5e19c94a
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -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);