• Andrew Morton's avatar
    [PATCH] rmap: flush_dcache revisited · c4d92e6b
    Andrew Morton authored
    From: Hugh Dickins <hugh@veritas.com>
    
    One of the callers of flush_dcache_page is do_generic_mapping_read, where
    file is read without i_sem and without page lock: concurrent truncation may
    at any moment remove page from cache, NULLing ->mapping, making
    flush_dcache_page liable to oops.  Put result of page_mapping in a local
    variable and apply mapping_mapped to that (if we were to check for NULL
    within mapping_mapped, it's unclear whether to say yes or no).
    
    parisc and arm do have other locking unsafety in their i_mmap(_shared)
    searching, but that's a larger issue to be dealt with down the line.
    c4d92e6b
cache.c 3.83 KB