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] [day] [month] [year] [list]
Date:   Wed, 24 May 2023 19:15:49 +0800
From:   Yue Hu <zbestahu@...il.com>
To:     Gao Xiang <hsiangkao@...ux.alibaba.com>
Cc:     xiang@...nel.org, chao@...nel.org, jefflexu@...ux.alibaba.com,
        linux-erofs@...ts.ozlabs.org, linux-kernel@...r.kernel.org,
        huyue2@...lpad.com, zhangwen@...lpad.com
Subject: Re: [PATCH] erofs: remove end parameter from
 z_erofs_pcluster_readmore()

On Wed, 24 May 2023 18:45:48 +0800
Gao Xiang <hsiangkao@...ux.alibaba.com> wrote:

> On 2023/5/24 03:13, Yue Hu wrote:
> > From: Yue Hu <huyue2@...lpad.com>
> > 
> > The `end` argument is pointless if it's not backmost.  And we already
> > have `headoffset` in struct `*f`, so let's use this offset to get the
> > `end` for backmost only instead in this function.
> > 
> > Also, remove linux/prefetch.h since it's not used anymore after commit
> > 386292919c25 ("erofs: introduce readmore decompression strategy").
> > 
> > Signed-off-by: Yue Hu <huyue2@...lpad.com>  
> > --->   fs/erofs/zdata.c | 19 ++++++++-----------  
> >   1 file changed, 8 insertions(+), 11 deletions(-)
> > 
> > diff --git a/fs/erofs/zdata.c b/fs/erofs/zdata.c
> > index 5cd971bcf95e..b7ebdc8f2135 100644
> > --- a/fs/erofs/zdata.c
> > +++ b/fs/erofs/zdata.c
> > @@ -5,7 +5,6 @@
> >    * Copyright (C) 2022 Alibaba Cloud
> >    */
> >   #include "compress.h"
> > -#include <linux/prefetch.h>
> >   #include <linux/psi.h>
> >   #include <linux/cpuhotplug.h>
> >   #include <trace/events/erofs.h>
> > @@ -1825,16 +1824,16 @@ static void z_erofs_runqueue(struct z_erofs_decompress_frontend *f,
> >    */
> >   static void z_erofs_pcluster_readmore(struct z_erofs_decompress_frontend *f,
> >   				      struct readahead_control *rac,
> > -				      erofs_off_t end,
> > -				      struct page **pagepool,
> > -				      bool backmost)
> > +				      struct page **pagepool, bool backmost)
> >   {
> >   	struct inode *inode = f->inode;
> >   	struct erofs_map_blocks *map = &f->map;
> > -	erofs_off_t cur;
> > +	erofs_off_t cur, end;
> >   	int err;
> >   
> >   	if (backmost) {
> > +		end = f->headoffset +
> > +		      rac ? readahead_length(rac) : PAGE_SIZE - 1;  
> 
> 		could we avoid "?:" here for readability?

Ok, let me change to use if-else branch.
And seems 'newstart' should be just `f->headoffset`.
I will send v2 later.

> 
> Thanks,
> Gao Xiang

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ