Re: [PATCH v2 46/46] mm/filemap: Add FGP_STABLE

From: Christoph Hellwig
Date: Wed Jun 23 2021 - 07:44:27 EST


On Tue, Jun 22, 2021 at 01:15:51PM +0100, Matthew Wilcox (Oracle) wrote:
> Allow filemap_get_folio() to wait for writeback to complete (if the
> filesystem wants that behaviour). This is the folio equivalent of
> grab_cache_page_write_begin(), which is moved into the folio-compat
> file as a reminder to migrate all the code using it. This paves the
> way for getting rid of AOP_FLAG_NOFS once grab_cache_page_write_begin()
> is removed.

We actually should kill FGP_NOFS as well by switching everything over
to memalloc_nofs_{save, restore} eventually, given how error prone
all these manual flags settings are.

> diff --git a/mm/folio-compat.c b/mm/folio-compat.c
> index 78365eaee7d3..206bedd621d0 100644
> --- a/mm/folio-compat.c
> +++ b/mm/folio-compat.c
> @@ -115,6 +115,7 @@ void lru_cache_add(struct page *page)
> }
> EXPORT_SYMBOL(lru_cache_add);
>
> +noinline
> struct page *pagecache_get_page(struct address_space *mapping, pgoff_t index,
> int fgp_flags, gfp_t gfp)

How did that sneak in here?

Otherwise:

Reviewed-by: Christoph Hellwig <hch@xxxxxx>