• Brian Foster's avatar
    xfs: define bug_on_assert debug mode sysfs tunable · ccdab3d6
    Brian Foster authored
    In DEBUG mode, assert failures unconditionally trigger a kernel BUG.
    This is useful in diagnostic situations to panic a system and
    collect detailed state information at the time of a failure.
    This can also cause problems in cases where DEBUG mode code is
    desired but it is preferable not trigger kernel BUGs on assert
    failure. For example, during development of new code or during
    certain xfstests tests that intentionally cause corruption and test
    the kernel for survival (but otherwise may expect to trigger assert
    To provide additional flexibility, create the
    <sysfs>/fs/xfs/debug/bug_on_assert tunable to configure assert
    failure behavior at runtime. This tunable is only available in DEBUG
    mode and is enabled by default to preserve existing default
    behavior. When disabled, assert failures in DEBUG mode result in
    kernel warnings.
    Signed-off-by: 's avatarBrian Foster <bfoster@redhat.com>
    Reviewed-by: 's avatarDarrick J. Wong <darrick.wong@oracle.com>
    Signed-off-by: 's avatarDarrick J. Wong <darrick.wong@oracle.com>