From e6bdfb225cd4c180eac171ece0ecb16a57810cdc Mon Sep 17 00:00:00 2001 From: Hyesoo Yu Date: Tue, 28 Aug 2018 19:59:18 +0900 Subject: [PATCH] mm/gup: fix condition to check need migration If POLL_CMA is not set or POLL_GET is not set, get_user_pages need not to migrate CMA pages. But current conditional expression, get_user_pages need not to migration if both POLL_GET and POLL_CMA is not set. Change-Id: I243c8b03ae8099027559567231f09c7fb8fede51 Signed-off-by: Hyesoo Yu --- mm/gup.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mm/gup.c b/mm/gup.c index 62d38d58dbdd..190e4c74a276 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -36,7 +36,7 @@ static bool __need_migrate_cma_page(struct page *page, struct vm_area_struct *vma, unsigned long start, unsigned int flags) { - if (!(flags & (FOLL_GET | FOLL_CMA))) + if (!(flags & FOLL_GET) || !(flags & FOLL_CMA)) return false; if (!is_migrate_cma_page(page)) -- 2.20.1