Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

[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 <blaisorblade@yahoo.it>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>

authored by

Paolo 'Blaisorblade' Giarrusso and committed by
Linus Torvalds
16b03678 d129f312

+1 -2
+1 -2
arch/um/kernel/trap_kern.c
··· 85 85 pte = pte_offset_kernel(pmd, address); 86 86 } while(!pte_present(*pte)); 87 87 err = 0; 88 - *pte = pte_mkyoung(*pte); 89 - if(pte_write(*pte)) *pte = pte_mkdirty(*pte); 88 + WARN_ON(!pte_young(*pte) || (is_write && !pte_dirty(*pte))); 90 89 flush_tlb_page(vma, address); 91 90 out: 92 91 up_read(&mm->mmap_sem);