From: Hugh Dickins Date: Thu, 21 Jun 2007 22:27:45 +0000 (+0100) Subject: page_mapping must avoid slub pages X-Git-Tag: v2.6.22-rc6~44 X-Git-Url: http://www.pilppa.org/gitweb/gitweb.cgi?a=commitdiff_plain;h=b9bae3402572dc50a1e084c5b1ae5117918ef0f0;p=linux-2.6-omap-h63xx.git 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 Cc: Nicolas Ferre Cc: Christoph Lameter Cc: Andrew Morton Signed-off-by: Linus Torvalds --- diff --git a/include/linux/mm.h b/include/linux/mm.h index e4183c6c7de..1c1207472bb 100644 --- a/include/linux/mm.h +++ b/include/linux/mm.h @@ -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;