mm/vma: replace all remaining open encodings with vma_is_anonymous()
[linux-block.git] / mm / gup.c
index 4d505c99462313087a2155bbbdb6174eccdc4d2b..96af7e08db4bb9c114fd15520ee76300f6fbae08 100644 (file)
--- a/mm/gup.c
+++ b/mm/gup.c
@@ -351,7 +351,8 @@ static struct page *no_page_table(struct vm_area_struct *vma,
         * But we can only make this optimization where a hole would surely
         * be zero-filled if handle_mm_fault() actually did handle it.
         */
-       if ((flags & FOLL_DUMP) && (!vma->vm_ops || !vma->vm_ops->fault))
+       if ((flags & FOLL_DUMP) &&
+                       (vma_is_anonymous(vma) || !vma->vm_ops->fault))
                return ERR_PTR(-EFAULT);
        return NULL;
 }