ext4: try all groups in ext4_mb_new_blocks_simple
authorKemeng Shi <shikemeng@huaweicloud.com>
Sat, 3 Jun 2023 15:03:15 +0000 (23:03 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 15 Jun 2023 04:02:10 +0000 (00:02 -0400)
commit19a043bb1fd1b5cb2652ca33536c55e6c0a70df0
treef9685a5e8330a5dd88e8d644a4b43c6eb59814fc
parent95a4c3c7e0342f553fed1ac70d10c2efc6bba3b1
ext4: try all groups in ext4_mb_new_blocks_simple

ext4_mb_new_blocks_simple ignores the group before goal, so it will fail
if free blocks reside in group before goal. Try all groups to avoid
unexpected failure.
Search finishes either if any free block is found or if no available
blocks are found. Simpliy check "i >= max" to distinguish the above
cases.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
Suggested-by: Theodore Ts'o <tytso@mit.edu>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Link: https://lore.kernel.org/r/20230603150327.3596033-8-shikemeng@huaweicloud.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
fs/ext4/mballoc.c