diff mbox series

[3/8] ext4: fix wrong unit use in ext4_mb_new_inode_pa

Message ID 20230321161220.418652-4-shikemeng@huaweicloud.com
State Superseded
Headers show
Series Some fixes and cleanup to mballoc | expand

Commit Message

Kemeng Shi March 21, 2023, 4:12 p.m. UTC
fe_logical and win are both in block unit. Remove wrong convertion for
win from block unit to cluster unit.

Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
---
 fs/ext4/mballoc.c | 3 +--
 1 file changed, 1 insertion(+), 2 deletions(-)

Comments

Ojaswin Mujoo April 5, 2023, 7:26 p.m. UTC | #1
On Wed, Mar 22, 2023 at 12:12:15AM +0800, Kemeng Shi wrote:
> fe_logical and win are both in block unit. Remove wrong convertion for
> win from block unit to cluster unit.
> 
> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
> ---
>  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 7f695830621a..86d978e1f7dc 100644
> --- a/fs/ext4/mballoc.c
> +++ b/fs/ext4/mballoc.c
> @@ -4640,8 +4640,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
>  		if (offs && offs < win)
>  			win = offs;
>  
> -		ac->ac_b_ex.fe_logical = ac->ac_o_ex.fe_logical -
> -			EXT4_NUM_B2C(sbi, win);
> +		ac->ac_b_ex.fe_logical = ac->ac_o_ex.fe_logical - win;
>  		BUG_ON(ac->ac_o_ex.fe_logical < ac->ac_b_ex.fe_logical);
>  		BUG_ON(ac->ac_o_ex.fe_len > ac->ac_b_ex.fe_len);

So this bit of code is removed in the patchset I sent here [1]. My patchset
is mostly ready to be merged and Ted did mention that he was going to
pick that up soon. So would it be okay with you if we drop this particular patch?

[1]
https://lore.kernel.org/linux-ext4/9b35f3955a1d7b66bbd713eca1e63026e01f78c1.1679731817.git.ojaswin@linux.ibm.com
>  	}
> -- 
> 2.30.0
>
Kemeng Shi April 6, 2023, 1:36 a.m. UTC | #2
on 4/6/2023 3:26 AM, Ojaswin Mujoo wrote:
> On Wed, Mar 22, 2023 at 12:12:15AM +0800, Kemeng Shi wrote:
>> fe_logical and win are both in block unit. Remove wrong convertion for
>> win from block unit to cluster unit.
>>
>> Signed-off-by: Kemeng Shi <shikemeng@huaweicloud.com>
>> ---
>>  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 7f695830621a..86d978e1f7dc 100644
>> --- a/fs/ext4/mballoc.c
>> +++ b/fs/ext4/mballoc.c
>> @@ -4640,8 +4640,7 @@ ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
>>  		if (offs && offs < win)
>>  			win = offs;
>>  
>> -		ac->ac_b_ex.fe_logical = ac->ac_o_ex.fe_logical -
>> -			EXT4_NUM_B2C(sbi, win);
>> +		ac->ac_b_ex.fe_logical = ac->ac_o_ex.fe_logical - win;
>>  		BUG_ON(ac->ac_o_ex.fe_logical < ac->ac_b_ex.fe_logical);
>>  		BUG_ON(ac->ac_o_ex.fe_len > ac->ac_b_ex.fe_len);
> 
> So this bit of code is removed in the patchset I sent here [1]. My patchset
> is mostly ready to be merged and Ted did mention that he was going to
> pick that up soon. So would it be okay with you if we drop this particular patch?
Sure, I will drop this in next version.
>>  	}
>> -- 
>> 2.30.0
>>
>
diff mbox series

Patch

diff --git a/fs/ext4/mballoc.c b/fs/ext4/mballoc.c
index 7f695830621a..86d978e1f7dc 100644
--- a/fs/ext4/mballoc.c
+++ b/fs/ext4/mballoc.c
@@ -4640,8 +4640,7 @@  ext4_mb_new_inode_pa(struct ext4_allocation_context *ac)
 		if (offs && offs < win)
 			win = offs;
 
-		ac->ac_b_ex.fe_logical = ac->ac_o_ex.fe_logical -
-			EXT4_NUM_B2C(sbi, win);
+		ac->ac_b_ex.fe_logical = ac->ac_o_ex.fe_logical - win;
 		BUG_ON(ac->ac_o_ex.fe_logical < ac->ac_b_ex.fe_logical);
 		BUG_ON(ac->ac_o_ex.fe_len > ac->ac_b_ex.fe_len);
 	}