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: <ZJr/UHDEIbieQOsv@casper.infradead.org>
Date:   Tue, 27 Jun 2023 16:25:04 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     Christoph Hellwig <hch@...radead.org>
Cc:     linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
        linux-kernel@...r.kernel.org, Jan Kara <jack@...e.com>,
        David Howells <dhowells@...hat.com>
Subject: Re: [PATCH 08/12] writeback: Factor writeback_get_folio() out of
 write_cache_pages()

On Mon, Jun 26, 2023 at 09:34:17PM -0700, Christoph Hellwig wrote:
> > +	for (;;) {
> > +		folio = writeback_get_next(mapping, wbc);
> > +		if (!folio)
> > +			return NULL;
> > +		wbc->done_index = folio->index;
> > +
> > +		folio_lock(folio);
> > +		if (likely(should_writeback_folio(mapping, wbc, folio)))
> > +			break;
> > +		folio_unlock(folio);
> > +	}
> > +
> > +	trace_wbc_writepage(wbc, inode_to_bdi(mapping->host));
> > +	return folio;
> 
> Same minor nitpick, why not:
> 
> 
> 	while ((folio = writeback_get_next(mapping, wbc)) {
> 		wbc->done_index = folio->index;
> 
> 		folio_lock(folio);
> 		if (likely(should_writeback_folio(mapping, wbc, folio))) {
> 			trace_wbc_writepage(wbc, inode_to_bdi(mapping->host));
> 			break;
> 		}
> 		folio_unlock(folio);
> 	}
> 
> 	return folio;
> 
> ?

Because we end up having to call writeback_finish() somewhere, and it's
neater to do it here than in either writeback_get_next() or both callers
of writeback_get_folio().

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ