]> git.proxmox.com Git - mirror_ubuntu-focal-kernel.git/blobdiff - mm/memory.c
Merge branch 'for-4.20/i2c-hid' into for-linus
[mirror_ubuntu-focal-kernel.git] / mm / memory.c
index 83aef222f11b3f1d847279e13f43358566a22b43..c467102a5cbc5de5ab2ea4dff740f2611c1124a4 100644 (file)
@@ -1022,7 +1022,7 @@ copy_one_pte(struct mm_struct *dst_mm, struct mm_struct *src_mm,
         * If it's a COW mapping, write protect it both
         * in the parent and the child
         */
-       if (is_cow_mapping(vm_flags)) {
+       if (is_cow_mapping(vm_flags) && pte_write(pte)) {
                ptep_set_wrprotect(src_mm, addr, src_pte);
                pte = pte_wrprotect(pte);
        }