diff options
author | Baokun Li <libaokun1@huawei.com> | 2025-07-14 21:03:20 +0800 |
---|---|---|
committer | Theodore Ts'o <tytso@mit.edu> | 2025-07-25 09:14:17 -0400 |
commit | 1c320d8e92925bb7615f83a7b6e3f402a5c2ca63 (patch) | |
tree | db1d464e5ffafee815bb44213b6b52450211d049 /rust/helpers/blk.c | |
parent | e7f101a8088770e8f3bb089f13652b9b0fd22b06 (diff) |
ext4: fix zombie groups in average fragment size lists
Groups with no free blocks shouldn't be in any average fragment size list.
However, when all blocks in a group are allocated(i.e., bb_fragments or
bb_free is 0), we currently skip updating the average fragment size, which
means the group isn't removed from its previous s_mb_avg_fragment_size[old]
list.
This created "zombie" groups that were always skipped during traversal as
they couldn't satisfy any block allocation requests, negatively impacting
traversal efficiency.
Therefore, when a group becomes completely full, bb_avg_fragment_size_order
is now set to -1. If the old order was not -1, a removal operation is
performed; if the new order is not -1, an insertion is performed.
Fixes: 196e402adf2e ("ext4: improve cr 0 / cr 1 group scanning")
CC: stable@vger.kernel.org
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Link: https://patch.msgid.link/20250714130327.1830534-11-libaokun1@huawei.com
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'rust/helpers/blk.c')
0 files changed, 0 insertions, 0 deletions