Re: [PATCH 05/14] iomap: Support THPs in invalidatepage

Brian Foster
2020-10-14T20:00:28Z

On Wed, Oct 14, 2020 at 06:26:34PM +0100, Matthew Wilcox wrote:
> On Wed, Oct 14, 2020 at 09:33:47AM -0700, Darrick J. Wong wrote:
> > > @@ -1415,7 +1420,6 @@ iomap_writepage_map(struct iomap_writepage_ctx *wpc,
> > > */
> > > if (wpc->ops->discard_page)
> > > wpc->ops->discard_page(page);
> > > - ClearPageUptodate(page);
> >
> > Er, I don't get it -- why do we now leave the page up to date after
> > writeback fails?
>
> The page is still uptodate -- every byte in this page is at least as new
> as the corresponding bytes on disk.
>

That seems rather odd if the preceding ->discard_page() turned an
underlying delalloc block into a hole. Technically the original written
data is still in the page, but it's no longer allocated/mapped or dirty
so really no longer in sync with on-disk state. Hm?

Brian