Commit d5c772ed authored by Hugh Dickins's avatar Hugh Dickins Committed by Linus Torvalds

[PATCH] vmtrunc: bug if page_mapped

If unmap_mapping_range (and mapping->truncate_count) are doing their jobs
right, truncate_complete_page should never find the page mapped: add BUG_ON
for our immediate testing, but this patch should probably not go to mainline -
a mapped page here is not a catastrophe.
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Signed-off-by: default avatarAndrew Morton <akpm@osdl.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@osdl.org>
parent 0b5d6831
...@@ -45,6 +45,7 @@ static inline void truncate_partial_page(struct page *page, unsigned partial) ...@@ -45,6 +45,7 @@ static inline void truncate_partial_page(struct page *page, unsigned partial)
static void static void
truncate_complete_page(struct address_space *mapping, struct page *page) truncate_complete_page(struct address_space *mapping, struct page *page)
{ {
BUG_ON(page_mapped(page));
if (page->mapping != mapping) if (page->mapping != mapping)
return; return;
......
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