aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c
index e98ecad2b9c8..40268410732a 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1141,9 +1141,12 @@ again:
1141 continue; 1141 continue;
1142 if (unlikely(details) && details->nonlinear_vma 1142 if (unlikely(details) && details->nonlinear_vma
1143 && linear_page_index(details->nonlinear_vma, 1143 && linear_page_index(details->nonlinear_vma,
1144 addr) != page->index) 1144 addr) != page->index) {
1145 set_pte_at(mm, addr, pte, 1145 pte_t ptfile = pgoff_to_pte(page->index);
1146 pgoff_to_pte(page->index)); 1146 if (pte_soft_dirty(ptent))
1147 pte_file_mksoft_dirty(ptfile);
1148 set_pte_at(mm, addr, pte, ptfile);
1149 }
1147 if (PageAnon(page)) 1150 if (PageAnon(page))
1148 rss[MM_ANONPAGES]--; 1151 rss[MM_ANONPAGES]--;
1149 else { 1152 else {
@@ -3410,6 +3413,8 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
3410 entry = mk_pte(page, vma->vm_page_prot); 3413 entry = mk_pte(page, vma->vm_page_prot);
3411 if (flags & FAULT_FLAG_WRITE) 3414 if (flags & FAULT_FLAG_WRITE)
3412 entry = maybe_mkwrite(pte_mkdirty(entry), vma); 3415 entry = maybe_mkwrite(pte_mkdirty(entry), vma);
3416 else if (pte_file(orig_pte) && pte_file_soft_dirty(orig_pte))
3417 pte_mksoft_dirty(entry);
3413 if (anon) { 3418 if (anon) {
3414 inc_mm_counter_fast(mm, MM_ANONPAGES); 3419 inc_mm_counter_fast(mm, MM_ANONPAGES);
3415 page_add_new_anon_rmap(page, vma, address); 3420 page_add_new_anon_rmap(page, vma, address);