Index: memory.c =================================================================== RCS file: /home/dot1/blah/cvs/linux/linux/mm/memory.c,v retrieving revision 1.4 diff -u -r1.4 memory.c --- memory.c 1997/07/30 02:15:34 1.4 +++ memory.c 1997/08/02 05:34:21 @@ -195,10 +195,16 @@ set_pte(new_pte, pte); return; } - if (cow) + if (cow) { pte = pte_wrprotect(pte); - if (delete_from_swap_cache(&mem_map[page_nr])) - pte = pte_mkdirty(pte); + if (pte_dirty(pte)) { + if (!mem_map[page_nr].inode) { + /* it's a private mapping, can be marked clean if removed from swap cache */ + delete_from_swap_cache(&mem_map[page_nr]); + pte = pte_mkclean(pte); + } + } + } set_pte(new_pte, pte_mkold(pte)); set_pte(old_pte, pte); atomic_inc(&mem_map[page_nr].count);