[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <f71c6d59-8d5f-46c0-bf17-51b0e7c9a6c8@huawei.com>
Date: Mon, 23 Jun 2025 16:12:36 +0800
From: Baokun Li <libaokun1@...wei.com>
To: Zhang Yi <yi.zhang@...weicloud.com>, <linux-ext4@...r.kernel.org>
CC: <linux-fsdevel@...r.kernel.org>, <linux-kernel@...r.kernel.org>,
<tytso@....edu>, <adilger.kernel@...ger.ca>, <jack@...e.cz>,
<ojaswin@...ux.ibm.com>, <yi.zhang@...wei.com>, <yukuai3@...wei.com>,
<yangerkun@...wei.com>, Baokun Li <libaokun1@...wei.com>
Subject: Re: [PATCH v2 6/6] ext4: fix insufficient credits calculation in
ext4_meta_trans_blocks()
On 2025/6/11 19:16, Zhang Yi wrote:
> From: Zhang Yi <yi.zhang@...wei.com>
>
> The calculation of journal credits in ext4_meta_trans_blocks() should
> include pextents, as each extent separately may be allocated from a
> different group and thus need to update different bitmap and group
> descriptor block.
>
> Fixes: 0e32d8617012 ("ext4: correct the journal credits calculations of allocating blocks")
> Reported-by: Jan Kara <jack@...e.cz>
> Closes: https://lore.kernel.org/linux-ext4/nhxfuu53wyacsrq7xqgxvgzcggyscu2tbabginahcygvmc45hy@t4fvmyeky33e/
> Signed-off-by: Zhang Yi <yi.zhang@...wei.com>
> Reviewed-by: Jan Kara <jack@...e.cz>
Looks good to me. Feel free to add:
Reviewed-by: Baokun Li <libaokun1@...wei.com>
> ---
> fs/ext4/inode.c | 4 ++--
> 1 file changed, 2 insertions(+), 2 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index 9835145b1b27..9b6ebf823740 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -6218,7 +6218,7 @@ int ext4_meta_trans_blocks(struct inode *inode, int lblocks, int pextents)
> int ret;
>
> /*
> - * How many index and lead blocks need to touch to map @lblocks
> + * How many index and leaf blocks need to touch to map @lblocks
> * logical blocks to @pextents physical extents?
> */
> idxblocks = ext4_index_trans_blocks(inode, lblocks, pextents);
> @@ -6227,7 +6227,7 @@ int ext4_meta_trans_blocks(struct inode *inode, int lblocks, int pextents)
> * Now let's see how many group bitmaps and group descriptors need
> * to account
> */
> - groups = idxblocks;
> + groups = idxblocks + pextents;
> gdpblocks = groups;
> if (groups > ngroups)
> groups = ngroups;
Powered by blists - more mailing lists