aboutsummaryrefslogtreecommitdiffstats
path: root/mm/memory.c
diff options
context:
space:
mode:
authorLinus Torvalds <torvalds@linux-foundation.org>2014-12-18 22:08:25 -0500
committerLinus Torvalds <torvalds@linux-foundation.org>2014-12-18 22:08:25 -0500
commit018cb13eb33383cbc3fb6d3a286ef32ecb816779 (patch)
treedcf098e343efa902b9de8580f3854440030e2ce2 /mm/memory.c
parent00c845dbfe2e966a2efd3818e40f46e286ca1ae6 (diff)
parent96e869d85745df36e3a1bf794ce472cc2b18939b (diff)
Merge branch 'akpm' (patches from Andrew)
Merge misc patches from Andrew Morton: "A few stragglers" * emailed patches from Andrew Morton <akpm@linux-foundation.org>: tools/testing/selftests/Makefile: alphasort the TARGETS list mm/zsmalloc: adjust order of functions ocfs2: fix journal commit deadlock ocfs2/dlm: fix race between dispatched_work and dlm_lockres_grab_inflight_worker ocfs2: reflink: fix slow unlink for refcounted file mm/memory.c:do_shared_fault(): add comment .mailmap: Santosh Shilimkar has moved .mailmap: update akpm@osdl.org lib/show_mem.c: add cma reserved information fs/proc/meminfo.c: include cma info in proc/meminfo mm: cma: split cma-reserved in dmesg log hfsplus: fix longname handling mm/mempolicy.c: remove unnecessary is_valid_nodemask()
Diffstat (limited to 'mm/memory.c')
-rw-r--r--mm/memory.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 6efe36a998ba..d8aebc52265f 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2996,6 +2996,12 @@ static int do_shared_fault(struct mm_struct *mm, struct vm_area_struct *vma,
2996 2996
2997 if (set_page_dirty(fault_page)) 2997 if (set_page_dirty(fault_page))
2998 dirtied = 1; 2998 dirtied = 1;
2999 /*
3000 * Take a local copy of the address_space - page.mapping may be zeroed
3001 * by truncate after unlock_page(). The address_space itself remains
3002 * pinned by vma->vm_file's reference. We rely on unlock_page()'s
3003 * release semantics to prevent the compiler from undoing this copying.
3004 */
2999 mapping = fault_page->mapping; 3005 mapping = fault_page->mapping;
3000 unlock_page(fault_page); 3006 unlock_page(fault_page);
3001 if ((dirtied || vma->vm_ops->page_mkwrite) && mapping) { 3007 if ((dirtied || vma->vm_ops->page_mkwrite) && mapping) {