diff options
| author | Baokun Li <libaokun1@huawei.com> | 2025-11-21 17:06:43 +0800 |
|---|---|---|
| committer | Theodore Ts'o <tytso@mit.edu> | 2025-11-28 22:35:27 -0500 |
| commit | 0ad55fa104a2aa5980c12f88546fab328d34644b (patch) | |
| tree | 14b9296c9ccb38d9554a0eee29e2a139b542c9ca /kernel/locking/mutex-debug.c | |
| parent | 3938fc29f89fff132929b2fea2fe00b0f43617ca (diff) | |
ext4: support large block size in ext4_mb_init_cache()
Currently, ext4_mb_init_cache() uses blocks_per_page to calculate the
folio index and offset. However, when blocksize is larger than PAGE_SIZE,
blocks_per_page becomes zero, leading to a potential division-by-zero bug.
Since we now have the folio, we know its exact size. This allows us to
convert {blocks, groups}_per_page to {blocks, groups}_per_folio, thus
supporting block sizes greater than page size.
Signed-off-by: Baokun Li <libaokun1@huawei.com>
Reviewed-by: Zhang Yi <yi.zhang@huawei.com>
Reviewed-by: Jan Kara <jack@suse.cz>
Reviewed-by: Ojaswin Mujoo <ojaswin@linux.ibm.com>
Message-ID: <20251121090654.631996-14-libaokun@huaweicloud.com>
Signed-off-by: Theodore Ts'o <tytso@mit.edu>
Diffstat (limited to 'kernel/locking/mutex-debug.c')
0 files changed, 0 insertions, 0 deletions
