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: Hugh 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: Linus Torvalds <torvalds@linux-foundation.org>

authored by

Hugh Dickins and committed by
Linus Torvalds
b9bae340 f1518a08

+4
+4
include/linux/mm.h
··· 603 603 604 604 if (unlikely(PageSwapCache(page))) 605 605 mapping = &swapper_space; 606 + #ifdef CONFIG_SLUB 607 + else if (unlikely(PageSlab(page))) 608 + mapping = NULL; 609 + #endif 606 610 else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON)) 607 611 mapping = NULL; 608 612 return mapping;