Skip to content
  • Arnd Bergmann's avatar
    kasan: only select SLUB_DEBUG with SYSFS=y · 03758dbb
    Arnd Bergmann authored
    Building with KASAN and SLUB but without sysfs now results in a
    build-time error:
    
      WARNING: unmet direct dependencies detected for SLUB_DEBUG
        Depends on [n]: SLUB [=y] && SYSFS [=n]
        Selected by [y]:
        - KASAN [=y] && HAVE_ARCH_KASAN [=y] && (SLUB [=y] || SLAB [=n] && !DEBUG_SLAB [=n]) && SLUB [=y]
      mm/slub.c:4565:12: error: 'list_locations' defined but not used [-Werror=unused-function]
       static int list_locations(struct kmem_cache *s, char *buf,
                  ^~~~~~~~~~~~~~
      mm/slub.c:4406:13: error: 'validate_slab_cache' defined but not used [-Werror=unused-function]
       static long validate_slab_cache(struct kmem_cache *s)
    
    This disallows that broken configuration in Kconfig.
    
    Link: http://lkml.kernel.org/r/20180709154019.1693026-1-arnd@arndb.de
    Fixes: dd275caf
    
     ("kasan: depend on CONFIG_SLUB_DEBUG")
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Cc: "Jason A. Donenfeld" <Jason@zx2c4.com>
    Cc: Arnd Bergmann <arnd@arndb.de>
    Cc: Shakeel Butt <shakeelb@google.com>
    Cc: Andrey Ryabinin <aryabinin@virtuozzo.com>
    Cc: Christoph Lameter <cl@linux.com>
    Signed-off-by: default avatarAndrew Morton <akpm@linux-foundation.org>
    Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
    03758dbb