summaryrefslogtreecommitdiff
path: root/mm
diff options
context:
space:
mode:
authorCyrill Gorcunov <gorcunov@gmail.com>2014-07-17 10:58:01 +1000
committerStephen Rothwell <sfr@canb.auug.org.au>2014-07-17 10:58:01 +1000
commit765deb1739adb542b12137adb75e50532f088909 (patch)
treee8e0e531c831674ae8747c372e0ee0710b410c1c /mm
parent41be98a15413a36fe124575bb40e29b863e62f54 (diff)
mm/memory.c: don't forget to set softdirty on file mapped fault
Otherwise we may not notice that pte was softdirty because pte_mksoft_dirty helper _returns_ new pte but doesn't modify the argument. In case if page fault happend on dirty filemapping the newly created pte may loose softdirty bit thus if a userspace program is tracking memory changes with help of a memory tracker (CONFIG_MEM_SOFT_DIRTY) it might miss modification of a memory page (which in worts case may lead to data inconsistency). Signed-off-by: Cyrill Gorcunov <gorcunov@openvz.org> Acked-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Diffstat (limited to 'mm')
-rw-r--r--mm/memory.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index 9c0cf0c09ceb..ab87cf4859f9 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -2746,7 +2746,7 @@ void do_set_pte(struct vm_area_struct *vma, unsigned long address,
if (write)
entry = maybe_mkwrite(pte_mkdirty(entry), vma);
else if (pte_file(*pte) && pte_file_soft_dirty(*pte))
- pte_mksoft_dirty(entry);
+ entry = pte_mksoft_dirty(entry);
if (anon) {
inc_mm_counter_fast(vma->vm_mm, MM_ANONPAGES);
page_add_new_anon_rmap(page, vma, address);