diff options
author | Kemeng Shi <[email protected]> | 2023-06-03 23:03:11 +0800 |
---|---|---|
committer | Theodore Ts'o <[email protected]> | 2023-06-15 00:02:10 -0400 |
commit | 99c515e3a860576ba90c11acbc1d6488dfca6463 (patch) | |
tree | 099942220d21c2f890ccf1f49d0a621b9010f84f | |
parent | 497885f72d930305d8e61b6b616b22b4da1adf90 (diff) |
ext4: fix wrong unit use in ext4_mb_find_by_goal
We need start in block unit while fe_start is in cluster unit. Use
ext4_grp_offs_to_block helper to convert fe_start to get start in
block unit.
Signed-off-by: Kemeng Shi <[email protected]>
Reviewed-by: Ojaswin Mujoo <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Theodore Ts'o <[email protected]>
-rw-r--r-- | fs/ext4/mballoc.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c index d8caef7cd9d0..f6dc4f276ca4 100644 --- a/fs/ext4/mballoc.c +++ b/fs/ext4/mballoc.c @@ -2210,8 +2210,7 @@ int ext4_mb_find_by_goal(struct ext4_allocation_context *ac, if (max >= ac->ac_g_ex.fe_len && ac->ac_g_ex.fe_len == sbi->s_stripe) { ext4_fsblk_t start; - start = ext4_group_first_block_no(ac->ac_sb, e4b->bd_group) + - ex.fe_start; + start = ext4_grp_offs_to_block(ac->ac_sb, &ex); /* use do_div to get remainder (would be 64-bit modulo) */ if (do_div(start, sbi->s_stripe) == 0) { ac->ac_found++; |