path: root/mm
diff options
authorPeter Feiner <>2014-09-25 16:05:29 -0700
committerLinus Torvalds <>2014-09-26 08:10:35 -0700
commitdbab31aa2ceec2d201966fa0b552f151310ba5f4 (patch)
treec25bb32ce0501315b98ce6f8838732639cedc14a /mm
parent6ff66ac77aeaa9c13db28784e1c50c027a1f487b (diff)
mm: softdirty: keep bit when zapping file pte
This fixes the same bug as b43790eedd31 ("mm: softdirty: don't forget to save file map softdiry bit on unmap") and 9aed8614af5a ("mm/memory.c: don't forget to set softdirty on file mapped fault") where the return value of pte_*mksoft_dirty was being ignored. To be sure that no other pte/pmd "mk" function return values were being ignored, I annotated the functions in arch/x86/include/asm/pgtable.h with __must_check and rebuilt. The userspace effect of this bug is that the softdirty mark might be lost if a file mapped pte get zapped. Signed-off-by: Peter Feiner <> Acked-by: Cyrill Gorcunov <> Cc: Pavel Emelyanov <> Cc: Jamie Liu <> Cc: Hugh Dickins <> Cc: <> [3.12+] Signed-off-by: Andrew Morton <> Signed-off-by: Linus Torvalds <>
Diffstat (limited to 'mm')
1 files changed, 1 insertions, 1 deletions
diff --git a/mm/memory.c b/mm/memory.c
index d17f1bcd2a91..e229970e4223 100644
--- a/mm/memory.c
+++ b/mm/memory.c
@@ -1127,7 +1127,7 @@ again:
addr) != page->index) {
pte_t ptfile = pgoff_to_pte(page->index);
if (pte_soft_dirty(ptent))
- pte_file_mksoft_dirty(ptfile);
+ ptfile = pte_file_mksoft_dirty(ptfile);
set_pte_at(mm, addr, pte, ptfile);
if (PageAnon(page))