Index: linux-2.6.21-rc7-mm2/include/linux/kernel.h =================================================================== --- linux-2.6.21-rc7-mm2.orig/include/linux/kernel.h 2007-04-26 18:33:37.000000000 -0700 +++ linux-2.6.21-rc7-mm2/include/linux/kernel.h 2007-04-26 18:41:40.000000000 -0700 @@ -355,6 +355,13 @@ struct sysinfo { aren't permitted). */ #define BUILD_BUG_ON_ZERO(e) (sizeof(char[1 - 2 * !!(e)]) - 1) +/* Fail compilation */ +#define BUILD_BUG(reason) \ +{ \ + extern void __build_bug_##reason(void); \ + __build_bug_##reason(); \ +} + /* Trap pasters of __FUNCTION__ at compile-time */ #define __FUNCTION__ (__func__) Index: linux-2.6.21-rc7-mm2/include/linux/slub_def.h =================================================================== --- linux-2.6.21-rc7-mm2.orig/include/linux/slub_def.h 2007-04-26 18:32:08.000000000 -0700 +++ linux-2.6.21-rc7-mm2/include/linux/slub_def.h 2007-04-26 18:44:29.000000000 -0700 @@ -10,6 +10,7 @@ #include #include #include +#include struct kmem_cache_node { spinlock_t list_lock; /* Protect partial list and nr_partial */ @@ -143,14 +144,8 @@ static inline struct kmem_cache *kmalloc if (index == 0) return NULL; - if (index < 0) { - /* - * Generate a link failure. Would be great if we could - * do something to stop the compile here. - */ - extern void __kmalloc_size_too_large(void); - __kmalloc_size_too_large(); - } + if (index < 0) + BUILD_BUG(kmalloc_size_too_large); return &kmalloc_caches[index]; } Index: linux-2.6.21-rc7-mm2/mm/slub.c =================================================================== --- linux-2.6.21-rc7-mm2.orig/mm/slub.c 2007-04-26 18:42:45.000000000 -0700 +++ linux-2.6.21-rc7-mm2/mm/slub.c 2007-04-26 18:43:12.000000000 -0700 @@ -107,7 +107,7 @@ */ /* Enable to test recovery from slab corruption on boot */ -#undef SLUB_RESILIENCY_TEST +#define SLUB_RESILIENCY_TEST #if PAGE_SHIFT <= 12