[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <YYK4YKCnDyoJx5eW@casper.infradead.org>
Date: Wed, 3 Nov 2021 16:27:12 +0000
From: Matthew Wilcox <willy@...radead.org>
To: David Howells <dhowells@...hat.com>
Cc: Jeff Layton <jlayton@...nel.org>,
Marc Dionne <marc.dionne@...istor.com>,
Ilya Dryomov <idryomov@...il.com>,
Dominique Martinet <asmadeus@...ewreck.org>,
v9fs-developer@...ts.sourceforge.net,
linux-afs@...ts.infradead.org, ceph-devel@...r.kernel.org,
linux-cachefs@...hat.com, linux-fsdevel@...r.kernel.org,
linux-nfs@...r.kernel.org, linux-cifs@...r.kernel.org,
devel@...ts.orangefs.org, linux-mm@...ck.org,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH v3 5/6] netfs, 9p, afs, ceph: Use folios
On Wed, Nov 03, 2021 at 02:58:12PM +0000, David Howells wrote:
> Matthew Wilcox <willy@...radead.org> wrote:
>
> > > + len = (size >= start + gran) ? gran : size - start;
> >
> > This seems like the most complicated way to write this ... how about:
> >
> > size_t len = min_t(loff_t, isize - start, folio_size(folio));
>
> I was trying to hedge against isize-start going negative. Can this code race
> against truncate? truncate_setsize() changes i_size *before* invalidating the
> pages.
We should check for isize < start separately, and skip the writeback
entirely.
> > > static int afs_symlink_readpage(struct file *file, struct page *page)
> > > {
> > > - struct afs_vnode *vnode = AFS_FS_I(page->mapping->host);
> > > + struct afs_vnode *vnode = AFS_FS_I(page_mapping(page)->host);
> >
> > How does swap end up calling readpage on a symlink?
>
> Um - readpage is called to read the symlink.
But the only reason to use page_mapping() instead of page->mapping
is if you don't know that the page is in the page cache. You know
that here, so I don't understand why you changed it.
> > > - page_endio(page, false, ret);
> > > + page_endio(&folio->page, false, ret);
> >
> > We need a folio_endio() ...
>
> I think we mentioned this before and I think you said you had or would make a
> patch for it. I can just create a wrapper for it if that'll do.
Probably better to convert it and put a page_endio wrapper in
folio-compat.c
Powered by blists - more mailing lists