]> Git Repo - linux.git/blobdiff - mm/mprotect.c
dt-bindings: PCI: brcm,stb-pcie: Use maxItems for reset controllers
[linux.git] / mm / mprotect.c
index 8c6cd88252738d00507df8b89f5caaad1a577a9c..222ab434da549dcd796d66144ed359efe0df98fa 100644 (file)
@@ -53,7 +53,7 @@ bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
                return false;
 
        /* Do we need write faults for softdirty tracking? */
-       if (vma_soft_dirty_enabled(vma) && !pte_soft_dirty(pte))
+       if (pte_needs_soft_dirty_wp(vma, pte))
                return false;
 
        /* Do we need write faults for uffd-wp tracking? */
@@ -71,6 +71,8 @@ bool can_change_pte_writable(struct vm_area_struct *vma, unsigned long addr,
                return page && PageAnon(page) && PageAnonExclusive(page);
        }
 
+       VM_WARN_ON_ONCE(is_zero_pfn(pte_pfn(pte)) && pte_dirty(pte));
+
        /*
         * Writable MAP_SHARED mapping: "clean" might indicate that the FS still
         * needs a real write-fault for writenotify
This page took 0.030948 seconds and 4 git commands to generate.