]> git.baikalelectronics.ru Git - kernel.git/commit
ext4: modify the logic of ext4_mb_new_blocks_simple
authorXin Yin <yinxin.x@bytedance.com>
Mon, 10 Jan 2022 03:51:41 +0000 (11:51 +0800)
committerTheodore Ts'o <tytso@mit.edu>
Thu, 3 Feb 2022 15:56:24 +0000 (10:56 -0500)
commit7757aab3a2ea29e6e899a92f2fa3a001ce56149c
tree197eb2ce1cba325e14d9af85990f05087879ff30
parent0fb507b63d8a34e3e22d2d536fc1c8aebd1f4785
ext4: modify the logic of ext4_mb_new_blocks_simple

For now in ext4_mb_new_blocks_simple, if we found a block which
should be excluded then will switch to next group, this may
probably cause 'group' run out of range.

Change to check next block in the same group when get a block should
be excluded. Also change the search range to EXT4_CLUSTERS_PER_GROUP
and add error checking.

Signed-off-by: Xin Yin <yinxin.x@bytedance.com>
Reviewed-by: Harshad Shirwadkar <harshadshirwadkar@gmail.com>
Link: https://lore.kernel.org/r/20220110035141.1980-3-yinxin.x@bytedance.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Cc: stable@kernel.org
fs/ext4/mballoc.c