page_mapping must avoid slub pages
authorHugh Dickins <hugh@veritas.com>
Thu, 21 Jun 2007 22:27:45 +0000 (23:27 +0100)
committerLinus Torvalds <torvalds@woody.linux-foundation.org>
Thu, 21 Jun 2007 22:55:12 +0000 (15:55 -0700)
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>
include/linux/mm.h

index e4183c6c7de3dca209ed8f99eb852719e3f31bfb..1c1207472bb45657553ff349cf081c44840b310c 100644 (file)
@@ -603,6 +603,10 @@ static inline struct address_space *page_mapping(struct page *page)
 
        if (unlikely(PageSwapCache(page)))
                mapping = &swapper_space;
+#ifdef CONFIG_SLUB
+       else if (unlikely(PageSlab(page)))
+               mapping = NULL;
+#endif
        else if (unlikely((unsigned long)mapping & PAGE_MAPPING_ANON))
                mapping = NULL;
        return mapping;