Merge tag 'hwmon-for-v6.2-rc1' of git://git.kernel.org/pub/scm/linux/kernel/git/groec...
[linux-2.6-microblaze.git] / include / linux / userfaultfd_k.h
index f07e699..9df0b9a 100644 (file)
@@ -146,9 +146,9 @@ static inline bool userfaultfd_armed(struct vm_area_struct *vma)
 static inline bool vma_can_userfault(struct vm_area_struct *vma,
                                     unsigned long vm_flags)
 {
-       if (vm_flags & VM_UFFD_MINOR)
-               return is_vm_hugetlb_page(vma) || vma_is_shmem(vma);
-
+       if ((vm_flags & VM_UFFD_MINOR) &&
+           (!is_vm_hugetlb_page(vma) && !vma_is_shmem(vma)))
+               return false;
 #ifndef CONFIG_PTE_MARKER_UFFD_WP
        /*
         * If user requested uffd-wp but not enabled pte markers for