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

From: Johannes Weiner
Date: Tue Apr 10 2018 - 09:07:28 EST


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.

Could you please mention the nullptr crash here, maybe even in the
patch subject? That makes it much easier to find this patch when you
run into that bug or when evaluating backport candidates.

Other than that,

> Fixes: 19f99cee206c ("f2fs: add core inode operations")
> Reported-by: Minchan Kim <minchan@xxxxxxxxxx>
> Signed-off-by: Matthew Wilcox <mawilcox@xxxxxxxxxxxxx>
> Cc: stable@xxxxxxxxxxxxxxx

Acked-by: Johannes Weiner <hannes@xxxxxxxxxxx>