]> git.hungrycats.org Git - linux/commitdiff
[PATCH] vmtrunc: bug if page_mapped
authorHugh Dickins <hugh@veritas.com>
Sat, 8 Jan 2005 05:59:23 +0000 (21:59 -0800)
committerLinus Torvalds <torvalds@evo.osdl.org>
Sat, 8 Jan 2005 05:59:23 +0000 (21:59 -0800)
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: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@osdl.org>
Signed-off-by: Linus Torvalds <torvalds@osdl.org>
mm/truncate.c

index 7cd2ed501bb2f21f51282710cc7a8886b81153b6..733aa033678dd913ef7d977b4eac0adad0e4b250 100644 (file)
@@ -45,6 +45,7 @@ static inline void truncate_partial_page(struct page *page, unsigned partial)
 static void
 truncate_complete_page(struct address_space *mapping, struct page *page)
 {
+       BUG_ON(page_mapped(page));
        if (page->mapping != mapping)
                return;