Re: [PATCH 2/2] page cache: Mask off unwanted GFP flags

From: Matthew Wilcox
Date: Tue Apr 10 2018 - 10:02:34 EST


On Tue, Apr 10, 2018 at 10:45:45PM +0900, Minchan Kim wrote:
> On Tue, Apr 10, 2018 at 05:53:51AM -0700, Matthew Wilcox wrote:
> > From: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>
> >
> > The page cache has used the mapping's GFP flags for allocating
> > radix tree nodes for a long time. It took care to always mask off the
> > __GFP_HIGHMEM flag, and masked off other flags in other paths, but the
> > __GFP_ZERO flag was still able to sneak through. The __GFP_DMA and
> > __GFP_DMA32 flags would also have been able to sneak through if they
> > were ever used. Fix them all by using GFP_RECLAIM_MASK at the innermost
> > location, and remove it from earlier in the callchain.
> >
> > Fixes: 19f99cee206c ("f2fs: add core inode operations")
>
> Why this patch fix 19f99cee206c instead of 449dd6984d0e?
> F2FS doesn't have any problem before introducing 449dd6984d0e?

Well, there's the problem. This bug is the combination of three different
things:

1. The working set code relying on list_empty.
2. The page cache not filtering out the bad flags.
3. F2FS specifying a flag nobody had ever specified before.

So what single patch does this patch fix? I don't think it really matters.