From: Andrew Morton Date: Fri, 8 Sep 2006 16:48:38 +0000 (-0700) Subject: [PATCH] invalidate_complete_page() race fix X-Git-Tag: v2.6.18-rc7~19 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=016eb4a0ed06a3677d67a584da901f0e9a63c666;p=pandora-kernel.git [PATCH] invalidate_complete_page() race fix If a CPU faults this page into pagetables after invalidate_mapping_pages() checked page_mapped(), invalidate_complete_page() will still proceed to remove the page from pagecache. This leaves the page-faulting process with a detached page. If it was MAP_SHARED then file data loss will ensue. Fix that up by checking the page's refcount after taking tree_lock. Cc: Nick Piggin Cc: Hugh Dickins Cc: Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed