lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <c3dbd82a-75c2-969d-02ce-b7a31b29a95e@linux.alibaba.com>
Date:   Thu, 25 May 2023 13:56:14 +0800
From:   Gao Xiang <hsiangkao@...ux.alibaba.com>
To:     Yue Hu <zbestahu@...il.com>, xiang@...nel.org, chao@...nel.org,
        jefflexu@...ux.alibaba.com, linux-erofs@...ts.ozlabs.org
Cc:     linux-kernel@...r.kernel.org, huyue2@...lpad.com,
        zhangwen@...lpad.com
Subject: Re: [PATCH] erofs: don't calculate new start when expanding read
 length



On 2023/5/25 22:51, Yue Hu wrote:
> From: Yue Hu <huyue2@...lpad.com>
> 
> We only expand the trailing edge and not the leading edge.  So no need
> to obtain new start again.  Let's use the existing ->headoffset instead.
> 
> Signed-off-by: Yue Hu <huyue2@...lpad.com>
> ---
>   fs/erofs/zdata.c | 12 +++++-------
>   1 file changed, 5 insertions(+), 7 deletions(-)
> 
> diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> index 874fee35af32..bab8dcb8e848 100644
> --- a/fs/erofs/zdata.c
> +++ b/fs/erofs/zdata.c
> @@ -1828,26 +1828,24 @@ static void z_erofs_pcluster_readmore(struct z_erofs_decompress_frontend *f,
>   {
>   	struct inode *inode = f->inode;
>   	struct erofs_map_blocks *map = &f->map;
> -	erofs_off_t cur, end;
> +	erofs_off_t cur, end, headoffset = f->headoffset;


That is not quite useful, or could you merge this info the original patch?

Thanks,
Gao Xiang

>   	int err;
>   
>   	if (backmost) {
>   		if (rac)
> -			end = f->headoffset + readahead_length(rac) - 1;
> +			end = headoffset + readahead_length(rac) - 1;
>   		else
> -			end = f->headoffset + PAGE_SIZE - 1;
> +			end = headoffset + PAGE_SIZE - 1;
>   		map->m_la = end;
>   		err = z_erofs_map_blocks_iter(inode, map,
>   					      EROFS_GET_BLOCKS_READMORE);
>   		if (err)
>   			return;
>   
> -		/* expend ra for the trailing edge if readahead */
> +		/* expand ra for the trailing edge if readahead */
>   		if (rac) {
> -			loff_t newstart = readahead_pos(rac);
> -
>   			cur = round_up(map->m_la + map->m_llen, PAGE_SIZE);
> -			readahead_expand(rac, newstart, cur - newstart);
> +			readahead_expand(rac, headoffset, cur - headoffset);
>   			return;
>   		}
>   		end = round_up(end, PAGE_SIZE);

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ