Commit 45426812d6b601430d560cb6049757b5b0bc71c4

Authored by Nick Piggin
Committed by Linus Torvalds
1 parent f96efd585b

mm: debug check for the fault vs invalidate race

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 <npiggin@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>

Showing 1 changed file with 1 additions and 0 deletions Side-by-side Diff

... ... @@ -120,6 +120,7 @@
120 120 page->mapping = NULL;
121 121 mapping->nrpages--;
122 122 __dec_zone_page_state(page, NR_FILE_PAGES);
  123 + BUG_ON(page_mapped(page));
123 124 }
124 125  
125 126 void remove_from_page_cache(struct page *page)