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: <YPD1NLkRo0dneNii@casper.infradead.org>
Date:   Fri, 16 Jul 2021 03:55:48 +0100
From:   Matthew Wilcox <willy@...radead.org>
To:     "Darrick J. Wong" <djwong@...nel.org>
Cc:     linux-kernel@...r.kernel.org, linux-mm@...ck.org,
        linux-fsdevel@...r.kernel.org
Subject: Re: [PATCH v14 105/138] iomap: Convert iomap_add_to_ioend to take a
 folio

On Thu, Jul 15, 2021 at 03:01:20PM -0700, Darrick J. Wong wrote:
> On Thu, Jul 15, 2021 at 04:36:31AM +0100, Matthew Wilcox (Oracle) wrote:
> >  
> > -	merged = __bio_try_merge_page(wpc->ioend->io_bio, page, len, poff,
> > -			&same_page);
> >  	if (iop)
> >  		atomic_add(len, &iop->write_bytes_pending);
> > -
> > -	if (!merged) {
> > -		if (bio_full(wpc->ioend->io_bio, len)) {
> > -			wpc->ioend->io_bio =
> > -				iomap_chain_bio(wpc->ioend->io_bio);
> > -		}
> > -		bio_add_page(wpc->ioend->io_bio, page, len, poff);
> > +	if (!bio_add_folio(wpc->ioend->io_bio, folio, len, poff)) {
> > +		wpc->ioend->io_bio = iomap_chain_bio(wpc->ioend->io_bio);
> > +		bio_add_folio(wpc->ioend->io_bio, folio, len, poff);
> 
> The paranoiac in me wonders if we ought to have some sort of error
> checking here just in case we encounter double failures?

Maybe?  We didn't have it before, and it's just been allocated.
I'd defer to Christoph here.

> > -	for (i = 0, file_offset = page_offset(page);
> > -	     i < (PAGE_SIZE >> inode->i_blkbits) && file_offset < end_offset;
> > -	     i++, file_offset += len) {
> > +	for (i = 0; i < nblocks; i++, pos += len) {
> > +		if (pos >= end_offset)
> > +			break;
> 
> Any particular reason this isn't:
> 
> 	for (i = 0; i < nblocks && pos < end_offset; i++, pos += len) {
> 
> ?

Just mild personal preference ... I don't even like having the pos +=
len in there.  But you're maintainer, I'll shuffle that in.

> Everything from here on out looks decent to me.

Thanks!

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ