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)
committerCosmin Tanislav <demonsingur@gmail.com>
Mon, 22 Apr 2024 17:23:01 +0000 (20:23 +0300)
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 213dc1d2d9ff19cd85830cce06858af25a27717e..bbe0b456ef7739d7381e215c7c17b40e7de4f9dd 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))