• Arnd Bergmann's avatar
    dlm: remove BUG() before panic() · fe204591
    Arnd Bergmann authored
    Building a kernel with clang sometimes fails with an objtool error in dlm:
    
    fs/dlm/lock.o: warning: objtool: revert_lock_pc()+0xbd: can't find jump dest instruction at .text+0xd7fc
    
    The problem is that BUG() never returns and the compiler knows
    that anything after it is unreachable, however the panic still
    emits some code that does not get fully eliminated.
    
    Having both BUG() and panic() is really pointless as the BUG()
    kills the current process and the subsequent panic() never hits.
    In most cases, we probably don't really want either and should
    replace the DLM_ASSERT() statements with WARN_ON(), as has
    been done for some of them.
    
    Remove the BUG() here so the user at least sees the panic message
    and we can reliably build randconfig kernels.
    
    Fixes: e7fd4179 ("[DLM] The core of the DLM for GFS2/CLVM")
    Cc: Josh Poimboeuf <jpoimboe@redhat.com>
    Cc: clang-built-linux@googlegroups.com
    Signed-off-by: default avatarArnd Bergmann <arnd@arndb.de>
    Signed-off-by: default avatarDavid Teigland <teigland@redhat.com>
    fe204591
dlm_internal.h 19.9 KB