aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2013-08-14 13:04:43 -0400
committerLinus Torvalds <torvalds@linux-foundation.org>2013-08-14 13:04:43 -0400
commitf1d6e17f540af37bb1891480143669ba7636c4cf (patch)
tree962d95f43fe425c9a7d4c7f1316c76000bcec370 /mm/memory.c
parent28fbc8b6a29c849a3f03a6b05010d4b584055665 (diff)
parent8c8296223f3abb142be8fc31711b18a704c0e7d8 (diff)
Merge branch 'akpm' (patches from Andrew Morton)
Merge a bunch of fixes from Andrew Morton. * emailed patches from Andrew Morton <akpm@linux-foundation.org>: fs/proc/task_mmu.c: fix buffer overflow in add_page_map() arch: *: Kconfig: add "kernel/Kconfig.freezer" to "arch/*/Kconfig" ocfs2: fix null pointer dereference in ocfs2_dir_foreach_blk_id() x86 get_unmapped_area(): use proper mmap base for bottom-up direction ocfs2: fix NULL pointer dereference in ocfs2_duplicate_clusters_by_page ocfs2: Revert 40bd62e to avoid regression in extended allocation drivers/rtc/rtc-stmp3xxx.c: provide timeout for potentially endless loop polling a HW bit hugetlb: fix lockdep splat caused by pmd sharing aoe: adjust ref of head for compound page tails microblaze: fix clone syscall mm: save soft-dirty bits on file pages mm: save soft-dirty bits on swapped pages memcg: don't initialize kmem-cache destroying work for root caches
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c13
1 files changed, 10 insertions, 3 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 1ce2e2a734fc..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 {
@@ -3115,6 +3118,8 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma,
3115 exclusive = 1; 3118 exclusive = 1;
3116 } 3119 }
3117 flush_icache_page(vma, page); 3120 flush_icache_page(vma, page);
3121 if (pte_swp_soft_dirty(orig_pte))
3122 pte = pte_mksoft_dirty(pte);
3118 set_pte_at(mm, address, page_table, pte); 3123 set_pte_at(mm, address, page_table, pte);
3119 if (page == swapcache) 3124 if (page == swapcache)
3120 do_page_add_anon_rmap(page, vma, address, exclusive); 3125 do_page_add_anon_rmap(page, vma, address, exclusive);
@@ -3408,6 +3413,8 @@ static int __do_fault(struct mm_struct *mm, struct vm_area_struct *vma,
3408 entry = mk_pte(page, vma->vm_page_prot); 3413 entry = mk_pte(page, vma->vm_page_prot);
3409 if (flags & FAULT_FLAG_WRITE) 3414 if (flags & FAULT_FLAG_WRITE)
3410 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);
3411 if (anon) { 3418 if (anon) {
3412 inc_mm_counter_fast(mm, MM_ANONPAGES); 3419 inc_mm_counter_fast(mm, MM_ANONPAGES);
3413 page_add_new_anon_rmap(page, vma, address); 3420 page_add_new_anon_rmap(page, vma, address);