[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <ZC/4PrHJhXS79xA7@li-bb2b2a4c-3307-11b2-a85c-8fa5c3a69313.ibm.com>
Date: Fri, 7 Apr 2023 16:32:22 +0530
From: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
To: Kemeng Shi <shikemeng@...weicloud.com>
Cc: tytso@....edu, adilger.kernel@...ger.ca,
linux-ext4@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 4/8] ext4: fix wrong unit use in ext4_mb_find_by_goal
On Wed, Mar 22, 2023 at 12:12:16AM +0800, Kemeng Shi wrote:
> 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 <shikemeng@...weicloud.com>
Feel free to add:
Reviewed-by: Ojaswin Mujoo <ojaswin@...ux.ibm.com>
Regards,
ojaswin
> ---
> fs/ext4/mballoc.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
> index 86d978e1f7dc..9a40e165e7d2 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -2181,8 +2181,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++;
> --
> 2.30.0
>
Powered by blists - more mailing lists