[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <w7dawsu3tli23h6ezt4u7evprczgbezylnbyh3sqhv5rfimg4q@5vqelz5hsev6>
Date: Mon, 3 Nov 2025 08:41:42 +0100
From: Jan Kara <jack@...e.cz>
To: libaokun@...weicloud.com
Cc: linux-ext4@...r.kernel.org, tytso@....edu, adilger.kernel@...ger.ca,
jack@...e.cz, linux-kernel@...r.kernel.org, kernel@...kajraghav.com,
mcgrof@...nel.org, linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
yi.zhang@...wei.com, yangerkun@...wei.com, chengzhihao1@...wei.com,
libaokun1@...wei.com
Subject: Re: [PATCH 01/25] ext4: remove page offset calculation in
ext4_block_zero_page_range()
On Sat 25-10-25 11:21:57, libaokun@...weicloud.com wrote:
> From: Zhihao Cheng <chengzhihao1@...wei.com>
>
> For bs <= ps scenarios, calculating the offset within the block is
> sufficient. For bs > ps, an initial page offset calculation can lead to
> incorrect behavior. Thus this redundant calculation has been removed.
>
> Signed-off-by: Zhihao Cheng <chengzhihao1@...wei.com>
> Signed-off-by: Baokun Li <libaokun1@...wei.com>
> Reviewed-by: Zhang Yi <yi.zhang@...wei.com>
Looks good. Feel free to add:
Reviewed-by: Jan Kara <jack@...e.cz>
Honza
> ---
> fs/ext4/inode.c | 3 +--
> 1 file changed, 1 insertion(+), 2 deletions(-)
>
> diff --git a/fs/ext4/inode.c b/fs/ext4/inode.c
> index e99306a8f47c..0742039c53a7 100644
> --- a/fs/ext4/inode.c
> +++ b/fs/ext4/inode.c
> @@ -4157,9 +4157,8 @@ static int ext4_block_zero_page_range(handle_t *handle,
> struct address_space *mapping, loff_t from, loff_t length)
> {
> struct inode *inode = mapping->host;
> - unsigned offset = from & (PAGE_SIZE-1);
> unsigned blocksize = inode->i_sb->s_blocksize;
> - unsigned max = blocksize - (offset & (blocksize - 1));
> + unsigned int max = blocksize - (from & (blocksize - 1));
>
> /*
> * correct length if it does not fall between
> --
> 2.46.1
>
--
Jan Kara <jack@...e.com>
SUSE Labs, CR
Powered by blists - more mailing lists