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: <20200130213533.GN6615@bombadil.infradead.org>
Date:   Thu, 30 Jan 2020 13:35:33 -0800
From:   Matthew Wilcox <willy@...radead.org>
To:     Dave Chinner <david@...morbit.com>
Cc:     linux-fsdevel@...r.kernel.org, linux-mm@...ck.org,
        linux-kernel@...r.kernel.org
Subject: Re: [PATCH 11/12] fuse: Convert from readpages to readahead

On Wed, Jan 29, 2020 at 12:08:29PM +1100, Dave Chinner wrote:
> On Fri, Jan 24, 2020 at 05:35:52PM -0800, Matthew Wilcox wrote:
> > +	while (nr_pages--) {
> > +		struct page *page = readahead_page(mapping, start++);
> > +		int err = fuse_readpages_fill(&data, page);
> > +
> > +		if (!err)
> > +			continue;
> > +		nr_pages++;
> > +		goto out;
> >  	}
> 
> That's some pretty convoluted logic. Perhaps:
> 
> 	for (; nr_pages > 0 ; nr_pages--) {
> 		struct page *page = readahead_page(mapping, start++);
> 
> 		if (fuse_readpages_fill(&data, page))
> 			goto out;
> 	}

I have a bit of an aversion to that style of for loop ... I like this
instead:

        while (nr_pages) {
                struct page *page = readahead_page(mapping, start++);

                if (fuse_readpages_fill(&data, page) != 0)
                        goto out;
                nr_pages--;
        }

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ