From: Matthew Wilcox <willy@infradead.org>
To: David Howells <dhowells@redhat.com>
Cc: linux-cachefs@redhat.com,
Kent Overstreet <kent.overstreet@gmail.com>,
linux-mm@kvack.org, linux-fsdevel@vger.kernel.org,
Trond Myklebust <trondmy@hammerspace.com>,
Anna Schumaker <anna.schumaker@netapp.com>,
Steve French <sfrench@samba.org>,
Dominique Martinet <asmadeus@codewreck.org>,
Jeff Layton <jlayton@redhat.com>,
Alexander Viro <viro@zeniv.linux.org.uk>,
Omar Sandoval <osandov@osandov.com>,
Linus Torvalds <torvalds@linux-foundation.org>,
linux-afs@lists.infradead.org, linux-nfs@vger.kernel.org,
linux-cifs@vger.kernel.org, ceph-devel@vger.kernel.org,
v9fs-developer@lists.sourceforge.net,
linux-kernel@vger.kernel.org
Subject: Re: [PATCH 01/67] mm: Stop filemap_read() from grabbing a superfluous page
Date: Tue, 19 Oct 2021 21:04:51 +0100 [thread overview]
Message-ID: <YW8k4wEpt3Ehz5Hf@casper.infradead.org> (raw)
In-Reply-To: <2971214.1634669295@warthog.procyon.org.uk>
On Tue, Oct 19, 2021 at 07:48:15PM +0100, David Howells wrote:
> Matthew Wilcox <willy@infradead.org> wrote:
>
> > > + isize = i_size_read(inode);
> > > + if (unlikely(iocb->ki_pos >= isize))
> > > + goto put_pages;
> > > +
> >
> > Is there a good reason to assign to isize here? I'd rather not,
> > because it complicates analysis, and a later change might look at
> > the isize read here, not realising it was a racy use. So I'd
> > rather see:
>
> If we don't set isize, the loop will never end. Actually, maybe we can just
> break out at that point rather than going to put_pages.
Umm, yes, of course. Sorry.
It makes more sense to just break because we haven't got any pages,
so putting pages that we haven't got seems unnecessary.
>
next prev parent reply other threads:[~2021-10-19 20:07 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-10-18 14:50 [PATCH 00/67] fscache: Rewrite index API and management system David Howells
2021-10-18 14:50 ` [PATCH 01/67] mm: Stop filemap_read() from grabbing a superfluous page David Howells
2021-10-19 17:13 ` Jeff Layton
2021-10-19 18:28 ` Matthew Wilcox
2021-10-19 18:48 ` David Howells
2021-10-19 20:04 ` Matthew Wilcox [this message]
2021-10-19 13:29 ` [Linux-cachefs] [PATCH 00/67] fscache: Rewrite index API and management system Marc Dionne
2021-10-19 18:08 ` Jeff Layton
2021-10-19 19:00 ` David Howells
2021-10-21 22:20 ` Omar Sandoval
2021-10-21 23:15 ` Steve French
2021-10-21 23:43 ` Jeff Layton
2021-10-22 18:52 ` David Howells
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=YW8k4wEpt3Ehz5Hf@casper.infradead.org \
--to=willy@infradead.org \
--cc=anna.schumaker@netapp.com \
--cc=asmadeus@codewreck.org \
--cc=ceph-devel@vger.kernel.org \
--cc=dhowells@redhat.com \
--cc=jlayton@redhat.com \
--cc=kent.overstreet@gmail.com \
--cc=linux-afs@lists.infradead.org \
--cc=linux-cachefs@redhat.com \
--cc=linux-cifs@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linux-nfs@vger.kernel.org \
--cc=osandov@osandov.com \
--cc=sfrench@samba.org \
--cc=torvalds@linux-foundation.org \
--cc=trondmy@hammerspace.com \
--cc=v9fs-developer@lists.sourceforge.net \
--cc=viro@zeniv.linux.org.uk \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).