diff options
Diffstat (limited to 'mm/migrate.c')
-rw-r--r-- | mm/migrate.c | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/mm/migrate.c b/mm/migrate.c index f78ec9bd454d..2740360cd216 100644 --- a/mm/migrate.c +++ b/mm/migrate.c | |||
@@ -146,8 +146,11 @@ static int remove_migration_pte(struct page *new, struct vm_area_struct *vma, | |||
146 | pte = pte_mkold(mk_pte(new, vma->vm_page_prot)); | 146 | pte = pte_mkold(mk_pte(new, vma->vm_page_prot)); |
147 | if (pte_swp_soft_dirty(*ptep)) | 147 | if (pte_swp_soft_dirty(*ptep)) |
148 | pte = pte_mksoft_dirty(pte); | 148 | pte = pte_mksoft_dirty(pte); |
149 | |||
150 | /* Recheck VMA as permissions can change since migration started */ | ||
149 | if (is_write_migration_entry(entry)) | 151 | if (is_write_migration_entry(entry)) |
150 | pte = pte_mkwrite(pte); | 152 | pte = maybe_mkwrite(pte, vma); |
153 | |||
151 | #ifdef CONFIG_HUGETLB_PAGE | 154 | #ifdef CONFIG_HUGETLB_PAGE |
152 | if (PageHuge(new)) { | 155 | if (PageHuge(new)) { |
153 | pte = pte_mkhuge(pte); | 156 | pte = pte_mkhuge(pte); |