• A
    [PATCH] invalidate_complete_page() race fix · 016eb4a0
    Andrew Morton 提交于
    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 <nickpiggin@yahoo.com.au>
    Cc: Hugh Dickins <hugh@veritas.com>
    Cc: <stable@kernel.org>
    Signed-off-by: NAndrew Morton <akpm@osdl.org>
    Signed-off-by: NLinus Torvalds <torvalds@osdl.org>
    016eb4a0
truncate.c 9.7 KB