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

page_mapping must avoid slub pages

Nicolas Ferre reports oops from flush_dcache_page() on ARM when using
SLUB: which reuses page->mapping as page->slab.  The page_mapping()
function, used by ARM and PA-RISC flush_dcache_page() implementations,
must not confuse SLUB pages with those which have page->mapping set.
Signed-off-by: default avatarHugh Dickins <hugh@veritas.com>
Cc: Nicolas Ferre <nicolas.ferre@rfo.atmel.com>
Cc: Christoph Lameter <clameter@sgi.com>
Cc: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent f1518a08
...@@ -603,6 +603,10 @@ static inline struct address_space *page_mapping(struct page *page) ...@@ -603,6 +603,10 @@ static inline struct address_space *page_mapping(struct page *page)
if (unlikely(PageSwapCache(page))) if (unlikely(PageSwapCache(page)))
mapping = &swapper_space; mapping = &swapper_space;
#ifdef CONFIG_SLUB
else if (unlikely(PageSlab(page)))
mapping = NULL;
#endif
else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
mapping = NULL; mapping = NULL;
return mapping; return mapping;
......
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