pte_unmap(page_table); spin_unlock(&mm->page_table_lock); return VM_FAULT_MINOR|VM_FAULT_WRITE; 
ret |= VM_FAULT_WRITE; goto unlock; 
static int do_wp_page(struct mm_struct *mm, struct vm_area_struct * vma,	unsigned long address, pte_t *page_table, pmd_t *pmd, pte_t pte){	struct page *old_page, *new_page;	unsigned long pfn = pte_pfn(pte);	pte_t entry;	int ret;	if (unlikely(!pfn_valid(pfn))) {		/*		 * This should really halt the system so it can be debugged or		 * at least the kernel stops what it's doing before it corrupts		 * data, but for the moment just pretend this is OOM.		 */		pte_unmap(page_table);		printk(KERN_ERR "do_wp_page: bogus page at address %08lx\n",				address);		spin_unlock(&mm->page_table_lock);		return VM_FAULT_OOM;	}	old_page = pfn_to_page(pfn);	if (PageAnon(old_page) && !TestSetPageLocked(old_page)) {		int reuse = can_share_swap_page(old_page);		unlock_page(old_page);		if (reuse) {			flush_cache_page(vma, address, pfn);			entry = maybe_mkwrite(pte_mkyoung(pte_mkdirty(pte)),					      vma);			ptep_set_access_flags(vma, address, page_table, entry, 1);			update_mmu_cache(vma, address, entry);			lazy_mmu_prot_update(entry);			pte_unmap(page_table);			spin_unlock(&mm->page_table_lock);			return VM_FAULT_MINOR|VM_FAULT_WRITE;		}	}	pte_unmap(page_table);	/*	 * Ok, we need to copy. Oh, well..	 */	if (!PageReserved(old_page))		page_cache_get(old_page);	spin_unlock(&mm->page_table_lock);	if (unlikely(anon_vma_prepare(vma)))		goto no_new_page;	if (old_page == ZERO_PAGE(address)) {		new_page = alloc_zeroed_user_highpage(vma, address);		if (!new_page)			goto no_new_page;	} else {		new_page = alloc_page_vma(GFP_HIGHUSER, vma, address);		if (!new_page)			goto no_new_page;		copy_user_highpage(new_page, old_page, address);	}	/*	 * Re-check the pte - we dropped the lock	 */	ret = VM_FAULT_MINOR;	spin_lock(&mm->page_table_lock);	page_table = pte_offset_map(pmd, address);	if (likely(pte_same(*page_table, pte))) {		if (PageAnon(old_page))			dec_mm_counter(mm, anon_rss);		if (PageReserved(old_page))			inc_mm_counter(mm, rss);		else			page_remove_rmap(old_page);		flush_cache_page(vma, address, pfn);		break_cow(vma, new_page, address, page_table);		lru_cache_add_active(new_page);		page_add_anon_rmap(new_page, vma, address);		/* Free the old page.. */		new_page = old_page;		ret |= VM_FAULT_WRITE;	}	pte_unmap(page_table);	page_cache_release(new_page);	page_cache_release(old_page);	spin_unlock(&mm->page_table_lock);	return ret;no_new_page:	page_cache_release(old_page);	return VM_FAULT_OOM;}
4520	/local/tlutelli/issta_data/temp/c/2005_temp/2005/4520/65500d234e74fc4e8f18e1a429bc24e51e75de4a/memory.c/buggy/mm/memory.c