This is a note to let you know that I've just added the patch titled ext4: make directory inode spreading reflect flexbg size to the 5.10-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: ext4-make-directory-inode-spreading-reflect-flexbg-size.patch and it can be found in the queue-5.10 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. >From 613c5a85898d1cd44e68f28d65eccf64a8ace9cf Mon Sep 17 00:00:00 2001 From: Jan Kara <jack@xxxxxxx> Date: Thu, 8 Sep 2022 11:21:26 +0200 Subject: ext4: make directory inode spreading reflect flexbg size From: Jan Kara <jack@xxxxxxx> commit 613c5a85898d1cd44e68f28d65eccf64a8ace9cf upstream. Currently the Orlov inode allocator searches for free inodes for a directory only in flex block groups with at most inodes_per_group/16 more directory inodes than average per flex block group. However with growing size of flex block group this becomes unnecessarily strict. Scale allowed difference from average directory count per flex block group with flex block group size as we do with other metrics. Tested-by: Stefan Wahren <stefan.wahren@xxxxxxxx> Tested-by: Ojaswin Mujoo <ojaswin@xxxxxxxxxxxxx> Cc: stable@xxxxxxxxxx Link: https://lore.kernel.org/all/0d81a7c2-46b7-6010-62a4-3e6cfc1628d6@xxxxxxxx/ Signed-off-by: Jan Kara <jack@xxxxxxx> Link: https://lore.kernel.org/r/20220908092136.11770-3-jack@xxxxxxx Signed-off-by: Theodore Ts'o <tytso@xxxxxxx> Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx> --- fs/ext4/ialloc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) --- a/fs/ext4/ialloc.c +++ b/fs/ext4/ialloc.c @@ -508,7 +508,7 @@ static int find_group_orlov(struct super goto fallback; } - max_dirs = ndirs / ngroups + inodes_per_group / 16; + max_dirs = ndirs / ngroups + inodes_per_group*flex_size / 16; min_inodes = avefreei - inodes_per_group*flex_size / 4; if (min_inodes < 1) min_inodes = 1; Patches currently in stable-queue which might be from jack@xxxxxxx are queue-5.10/ext4-fix-bug-in-extents-parsing-when-eh_entries-0-and-eh_depth-0.patch queue-5.10/ext4-make-directory-inode-spreading-reflect-flexbg-size.patch