mm/gup: fix condition to check need migration
authorHyesoo Yu <hyesoo.yu@samsung.com>
Tue, 28 Aug 2018 10:59:18 +0000 (19:59 +0900)
committerhskang <hs1218.kang@samsung.com>
Wed, 29 Aug 2018 02:33:37 +0000 (11:33 +0900)
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 <hyesoo.yu@samsung.com>
mm/gup.c

index 62d38d58dbdd32dffe311d3eb76bfa715f45bbf6..190e4c74a2760aa128a137bef2cac57d52e1330e 100644 (file)
--- 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))