From 9a5b489b870def9a93f5e89dac03ebe136f901db Mon Sep 17 00:00:00 2001 From: Andrea Arcangeli Date: Mon, 9 Aug 2010 17:19:49 -0700 Subject: [PATCH] mm: set VM_FAULT_WRITE in do_swap_page() Set the flag if do_swap_page is decowing the page the same way do_wp_page would too. Signed-off-by: Andrea Arcangeli Cc: KOSAKI Motohiro Cc: Rik van Riel Cc: Nick Piggin Cc: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- mm/memory.c | 1 + 1 file changed, 1 insertion(+) diff --git a/mm/memory.c b/mm/memory.c index 6bc039486e9f..1ecca56e0a48 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -2723,6 +2723,7 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, if ((flags & FAULT_FLAG_WRITE) && reuse_swap_page(page)) { pte = maybe_mkwrite(pte_mkdirty(pte), vma); flags &= ~FAULT_FLAG_WRITE; + ret |= VM_FAULT_WRITE; exclusive = 1; } flush_icache_page(vma, page); -- 2.20.1