
From: Chen Wandun <chenwandun@huawei.com> hulk inclusion category: feature bugzilla: https://gitee.com/openeuler/kernel/issues/I4SK3S CVE: NA -------------------------------- __page_cache_alloc is used to alloc page cache in most file system, such as ext4, f2fs, so add ___GFP_RELIABILITY flag to support feature CONFIG_MEMORY_RELIABLE when alloc page. Signed-off-by: Chen Wandun <chenwandun@huawei.com> Reviewed-by: Kefeng Wang <wangkefeng.wang@huawei.com> Signed-off-by: Yang Yingliang <yangyingliang@huawei.com> --- include/linux/pagemap.h | 1 + mm/filemap.c | 1 + 2 files changed, 2 insertions(+) diff --git a/include/linux/pagemap.h b/include/linux/pagemap.h index 085aed892ce58..a6457acd7462e 100644 --- a/include/linux/pagemap.h +++ b/include/linux/pagemap.h @@ -249,6 +249,7 @@ extern struct page *__page_cache_alloc(gfp_t gfp); #else static inline struct page *__page_cache_alloc(gfp_t gfp) { + gfp |= ___GFP_RELIABILITY; return alloc_pages(gfp, 0); } #endif diff --git a/mm/filemap.c b/mm/filemap.c index f578d4e3e2c86..c30e5c1eb77c2 100644 --- a/mm/filemap.c +++ b/mm/filemap.c @@ -1042,6 +1042,7 @@ struct page *__page_cache_alloc(gfp_t gfp) int n; struct page *page; + gfp |= ___GFP_RELIABILITY; if (cpuset_do_page_mem_spread()) { unsigned int cpuset_mems_cookie; do { -- 2.25.1