History

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.

Peter Feiner committed 12 years ago

Commit dbab31a1 parent 6ff66ac1 file · +1 −1Browse files

Unified · Split

mm/memory.c+1−1
@@ -1127,7 +1127,7 @@ again: · 1126 unmodified lines
1127 addr) != page->index) {1127 addr) != page->index) {
1128 pte_t ptfile = pgoff_to_pte(page->index);1128 pte_t ptfile = pgoff_to_pte(page->index);
1129 if (pte_soft_dirty(ptent))1129 if (pte_soft_dirty(ptent))
1130 pte_file_mksoft_dirty(ptfile);1130 ptfile = pte_file_mksoft_dirty(ptfile);
1131 set_pte_at(mm, addr, pte, ptfile);1131 set_pte_at(mm, addr, pte, ptfile);
1132 }1132 }
1133 if (PageAnon(page))1133 if (PageAnon(page))

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t