]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
ext4: always allocate blocks only from groups inode can use
authorJan Kara <jack@suse.cz>
Wed, 14 Jan 2026 18:28:18 +0000 (19:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 26 Feb 2026 23:01:39 +0000 (15:01 -0800)
commit321ed8d559c951e71ad2d2d69a4cf0445644e865
tree00d2b203147e18f07645478c2d8ccbf6a87bf438
parent81982a11406c5da6c6e2b188028e7056e16b7128
ext4: always allocate blocks only from groups inode can use

commit 4865c768b563deff1b6a6384e74a62f143427b42 upstream.

For filesystems with more than 2^32 blocks inodes using indirect block
based format cannot use blocks beyond the 32-bit limit.
ext4_mb_scan_groups_linear() takes care to not select these unsupported
groups for such inodes however other functions selecting groups for
allocation don't. So far this is harmless because the other selection
functions are used only with mb_optimize_scan and this is currently
disabled for inodes with indirect blocks however in the following patch
we want to enable mb_optimize_scan regardless of inode format.

Reviewed-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Signed-off-by: Jan Kara <jack@suse.cz>
Acked-by: Pedro Falcato <pfalcato@suse.de>
Cc: stable@kernel.org
Link: https://patch.msgid.link/20260114182836.14120-3-jack@suse.cz
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
fs/ext4/mballoc.c