From: Nick Piggin Add a bugcheck for Andrea's pagefault vs invalidate race. This is triggerable for both linear and nonlinear pages with a userspace test harness (using direct IO and truncate, respectively). Signed-off-by: Nick Piggin Signed-off-by: Andrew Morton --- mm/filemap.c | 1 + 1 file changed, 1 insertion(+) diff -puN mm/filemap.c~mm-debug-check-for-the-fault-vs-invalidate-race mm/filemap.c --- a/mm/filemap.c~mm-debug-check-for-the-fault-vs-invalidate-race +++ a/mm/filemap.c @@ -120,6 +120,7 @@ void __remove_from_page_cache(struct pag page->mapping = NULL; mapping->nrpages--; __dec_zone_page_state(page, NR_FILE_PAGES); + BUG_ON(page_mapped(page)); } void remove_from_page_cache(struct page *page) _