Commit dbab31aa authored by Peter Feiner's avatar Peter Feiner Committed by Linus Torvalds
Browse files

mm: softdirty: keep bit when zapping file pte

This fixes the same bug as b43790ee ("mm: softdirty: don't forget to
save file map softdiry bit on unmap") and 9aed8614

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: default avatarPeter Feiner <>
Acked-by: default avatarCyrill Gorcunov <>
Cc: Pavel Emelyanov <>
Cc: Jamie Liu <>
Cc: Hugh Dickins <>
Cc: <>	[3.12+]
Signed-off-by: default avatarAndrew Morton <>
Signed-off-by: default avatarLinus Torvalds <>
parent 6ff66ac7
......@@ -1127,7 +1127,7 @@ again:
addr) != page->index) {
pte_t ptfile = pgoff_to_pte(page->index);
if (pte_soft_dirty(ptent))
ptfile = pte_file_mksoft_dirty(ptfile);
set_pte_at(mm, addr, pte, ptfile);
if (PageAnon(page))
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment