diff options
Diffstat (limited to 'mm/mprotect.c')
-rw-r--r-- | mm/mprotect.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/mm/mprotect.c b/mm/mprotect.c index 94722a4d6b43..a3af058f68e4 100644 --- a/mm/mprotect.c +++ b/mm/mprotect.c | |||
@@ -94,13 +94,16 @@ static unsigned long change_pte_range(struct vm_area_struct *vma, pmd_t *pmd, | |||
94 | swp_entry_t entry = pte_to_swp_entry(oldpte); | 94 | swp_entry_t entry = pte_to_swp_entry(oldpte); |
95 | 95 | ||
96 | if (is_write_migration_entry(entry)) { | 96 | if (is_write_migration_entry(entry)) { |
97 | pte_t newpte; | ||
97 | /* | 98 | /* |
98 | * A protection check is difficult so | 99 | * A protection check is difficult so |
99 | * just be safe and disable write | 100 | * just be safe and disable write |
100 | */ | 101 | */ |
101 | make_migration_entry_read(&entry); | 102 | make_migration_entry_read(&entry); |
102 | set_pte_at(mm, addr, pte, | 103 | newpte = swp_entry_to_pte(entry); |
103 | swp_entry_to_pte(entry)); | 104 | if (pte_swp_soft_dirty(oldpte)) |
105 | newpte = pte_swp_mksoft_dirty(newpte); | ||
106 | set_pte_at(mm, addr, pte, newpte); | ||
104 | } | 107 | } |
105 | pages++; | 108 | pages++; |
106 | } | 109 | } |