[PATCH] mm: do_swap_page race major
authorHugh Dickins <hugh@veritas.com>
Sun, 30 Oct 2005 01:16:15 +0000 (18:16 -0700)
committerLinus Torvalds <torvalds@g5.osdl.org>
Sun, 30 Oct 2005 04:40:39 +0000 (21:40 -0700)
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 <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/memory.c

index bc6296398f8bd44650bbf71b08de35c4c1d3aab8..a25ee1d3e20ac8bba15d6ac0310a0f1dd571f8db 100644 (file)
@@ -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;