Commit 45426812 authored by Nick Piggin's avatar Nick Piggin Committed by Linus Torvalds

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: default avatarNick Piggin <npiggin@suse.de>
Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f96efd58
...@@ -120,6 +120,7 @@ void __remove_from_page_cache(struct page *page) ...@@ -120,6 +120,7 @@ void __remove_from_page_cache(struct page *page)
page->mapping = NULL; page->mapping = NULL;
mapping->nrpages--; mapping->nrpages--;
__dec_zone_page_state(page, NR_FILE_PAGES); __dec_zone_page_state(page, NR_FILE_PAGES);
BUG_ON(page_mapped(page));
} }
void remove_from_page_cache(struct page *page) void remove_from_page_cache(struct page *page)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment