From: Christoph Lameter Date: Thu, 17 May 2007 05:11:21 +0000 (-0700) Subject: Fix page allocation flags in grow_dev_page() X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=ea125892a17f43919c726777ed1e4929d41e7984;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git Fix page allocation flags in grow_dev_page() grow_dev_page() simply passes GFP_NOFS to find_or_create_page. This means the allocation of radix tree nodes is done with GFP_NOFS and the allocation of a new page is done using GFP_NOFS. The mapping has a flags field that contains the necessary allocation flags for the page cache allocation. These need to be consulted in order to get DMA and HIGHMEM allocations etc right. And yes a blockdev could be allowing Highmem allocations if its a ramdisk. Cc: Hugh Dickins Signed-off-by: Christoph Lameter Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/fs/buffer.c b/fs/buffer.c index 3deeb886f6e6..49590d590d7d 100644 --- a/fs/buffer.c +++ b/fs/buffer.c @@ -981,7 +981,8 @@ grow_dev_page(struct block_device *bdev, sector_t block, struct page *page; struct buffer_head *bh; - page = find_or_create_page(inode->i_mapping, index, GFP_NOFS); + page = find_or_create_page(inode->i_mapping, index, + mapping_gfp_mask(inode->i_mapping) & ~__GFP_FS); if (!page) return NULL;