diff --git a/mm/gup.c b/mm/gup.c index 83f0737e57a715d7baccf24a8a4a669f060961e7..5801d4bd523a6252d29b9915c5966ffc43b50cb0 100644 --- a/mm/gup.c +++ b/mm/gup.c @@ -632,6 +632,7 @@ static int check_vma_flags(struct vm_area_struct *vma, unsigned long gup_flags) * were pinned, returns -errno. Each page returned must be released * with a put_page() call when it is finished with. vmas will only * remain valid while mmap_sem is held. + * -- 0 return value is possible when the fault would need to be retried. * * Must be called with mmap_sem held. It may be released. See below. * @@ -877,6 +878,10 @@ int fixup_user_fault(struct task_struct *tsk, struct mm_struct *mm, } EXPORT_SYMBOL_GPL(fixup_user_fault); +/* + * Please note that this function, unlike __get_user_pages will not + * return 0 for nr_pages > 0 without FOLL_NOWAIT + */ static __always_inline long __get_user_pages_locked(struct task_struct *tsk, struct mm_struct *mm, unsigned long start, diff --git a/mm/mempolicy.c b/mm/mempolicy.c index 59c7e6069c1e1f8be0aa147a87e57afd09172ef8..0bd78e8cdf89a4a8a853a561c7eed0bfa48df81d 100644 --- a/mm/mempolicy.c +++ b/mm/mempolicy.c @@ -901,10 +901,7 @@ static int lookup_node(unsigned long addr) int err; err = get_user_pages(addr & PAGE_MASK, 1, 0, &p, NULL); - if (err == 0) { - /* E.g. GUP interrupted by fatal signal */ - err = -EFAULT; - } else if (err > 0) { + if (err > 0) { err = page_to_nid(p); put_page(p); }