]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 16 Jun 2024 11:39:32 +0000 (13:39 +0200)
commit778b1ac4d6728fb709f927aebaac61f7eb672fba
treeb99ca072e2a02ba48aea2660ba32cd66f3b5e7cf
parent2b9310a99d5b807e913cf60be89504199142a4af
ext4: try all groups in ext4_mb_new_blocks_simple

[ Upstream commit 19a043bb1fd1b5cb2652ca33536c55e6c0a70df0 ]

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>
Stable-dep-of: 3f4830abd236 ("ext4: fix potential unnitialized variable")
Signed-off-by: Sasha Levin <sashal@kernel.org>
fs/ext4/mballoc.c