From: Hugh Dickins Date: Sun, 30 Oct 2005 01:16:15 +0000 (-0700) Subject: [PATCH] mm: do_swap_page race major X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=9e9bef07ce5a342aa6246ebc5c20829d0d5d63d0;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [PATCH] mm: do_swap_page race major Small adjustment: do_swap_page should report its !pte_same race as a major fault if it had to read into swap cache, because whatever raced with it will have found page already in cache and reported minor fault. Signed-off-by: Hugh Dickins Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/mm/memory.c b/mm/memory.c index bc6296398f8b..a25ee1d3e20a 100644 --- a/mm/memory.c +++ b/mm/memory.c @@ -1728,10 +1728,8 @@ static int do_swap_page(struct mm_struct *mm, struct vm_area_struct *vma, */ spin_lock(&mm->page_table_lock); page_table = pte_offset_map(pmd, address); - if (unlikely(!pte_same(*page_table, orig_pte))) { - ret = VM_FAULT_MINOR; + if (unlikely(!pte_same(*page_table, orig_pte))) goto out_nomap; - } if (unlikely(!PageUptodate(page))) { ret = VM_FAULT_SIGBUS;