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: <YYOcGK43XbnumvHi@infradead.org>
Date:   Thu, 4 Nov 2021 01:38:48 -0700
From:   Christoph Hellwig <hch@...radead.org>
To:     Matthew Wilcox <willy@...radead.org>
Cc:     Christoph Hellwig <hch@...radead.org>,
        "Darrick J. Wong" <djwong@...nel.org>, linux-xfs@...r.kernel.org,
        linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org,
        linux-block@...r.kernel.org, Jens Axboe <axboe@...nel.dk>
Subject: Re: [PATCH 18/21] iomap: Convert iomap_add_to_ioend to take a folio

On Thu, Nov 04, 2021 at 03:33:52AM +0000, Matthew Wilcox wrote:
> On Wed, Nov 03, 2021 at 08:54:50AM -0700, Christoph Hellwig wrote:
> > > -	 * Walk through the page to find areas to write back. If we run off the
> > > -	 * end of the current map or find the current map invalid, grab a new
> > > -	 * one.
> > > +	 * Walk through the folio to find areas to write back. If we
> > > +	 * run off the end of the current map or find the current map
> > > +	 * invalid, grab a new one.
> > 
> > No real need for reflowing the comment, it still fits just fine even
> > with the folio change.
> 
> Sure, but I don't like using column 79, unless it's better to.  We're on
> three lines anyway; may as well make better use of that third line.

Ok, tht's a little weird but a personal preference.  That being said
reflowing the whole comment just for that seems odd.

> 
> > > +	isize = i_size_read(inode);
> > > +	end_pos = page_offset(page) + PAGE_SIZE;
> > > +	if (end_pos - 1 >= isize) {
> > 
> > Wouldn't this check be more obvious as:
> > 
> > 	if (end_pos > i_size) {
> 
> I _think_ we restrict the maximum file size to 2^63 - 1 to avoid i_size
> ever being negative.  But that means that end_pos might be 2^63 (ie
> LONG_MIN), so we need to subtract one from it to get the right answer.
> Maybe worth a comment?

Yes, please.

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ