From: Paolo 'Blaisorblade' Giarrusso Date: Sat, 10 Sep 2005 17:44:58 +0000 (+0200) Subject: [PATCH] uml: avoid already done dirtying X-Git-Tag: v2.6.14-rc1~130 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=16b036786a6bd08cf7a91e0cd58219a6717da2a6;p=linux-2.6-omap-h63xx.git [PATCH] uml: avoid already done dirtying The PTE returned from handle_mm_fault is already marked as dirty and accessed if needed. Also, since this is not set with set_pte() (which sets NEWPAGE and NEWPROT as needed), this wouldn't work anyway. This version has been updated and fixed, thanks to some feedback from Jeff Dike. Signed-off-by: Paolo 'Blaisorblade' Giarrusso Signed-off-by: Linus Torvalds --- diff --git a/arch/um/kernel/trap_kern.c b/arch/um/kernel/trap_kern.c index d20361dcd12..87cc6fd76ce 100644 --- a/arch/um/kernel/trap_kern.c +++ b/arch/um/kernel/trap_kern.c @@ -85,8 +85,7 @@ survive: pte = pte_offset_kernel(pmd, address); } while(!pte_present(*pte)); err = 0; - *pte = pte_mkyoung(*pte); - if(pte_write(*pte)) *pte = pte_mkdirty(*pte); + WARN_ON(!pte_young(*pte) || (is_write && !pte_dirty(*pte))); flush_tlb_page(vma, address); out: up_read(&mm->mmap_sem);