|
@@ -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
|
|
* If it's a COW mapping, write protect it both
|
|
* in the parent and the child
|
|
* 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);
|
|
ptep_set_wrprotect(src_mm, addr, src_pte);
|
|
pte = pte_wrprotect(pte);
|
|
pte = pte_wrprotect(pte);
|
|
}
|
|
}
|