Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 1040960e authored by Brian Foster's avatar Brian Foster Committed by Darrick J. Wong
Browse files

xfs: define fatal assert build time tunable



While configurable at runtime, the DEBUG mode assert failure
behavior is usually either desired or not for a particular
situation. For example, developers using kernel modules may prefer
for fatal asserts to remain disabled across module reloads while QE
engineers doing broad regression testing may prefer to have fatal
asserts enabled on boot to facilitate data collection for bug
reports.

To provide a compromise/convenience for developers, create a Kconfig
option that sets the default value of the DEBUG mode 'bug_on_assert'
sysfs tunable. The default behavior remains to trigger kernel BUGs
on assert failures to preserve existing behavior across kernel
configuration updates with DEBUG mode enabled.

Signed-off-by: default avatarBrian Foster <bfoster@redhat.com>
Reviewed-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
Signed-off-by: default avatarDarrick J. Wong <darrick.wong@oracle.com>
parent ccdab3d6
Loading
Loading
Loading
Loading
+13 −0
Original line number Original line Diff line number Diff line
@@ -96,3 +96,16 @@ config XFS_DEBUG
	  not useful unless you are debugging a particular problem.
	  not useful unless you are debugging a particular problem.


	  Say N unless you are an XFS developer, or you play one on TV.
	  Say N unless you are an XFS developer, or you play one on TV.

config XFS_ASSERT_FATAL
	bool "XFS fatal asserts"
	default y
	depends on XFS_FS && XFS_DEBUG
	help
	  Set the default DEBUG mode ASSERT failure behavior.

	  Say Y here to cause DEBUG mode ASSERT failures to result in fatal
	  errors that BUG() the kernel by default. If you say N, ASSERT failures
	  result in warnings.

	  This behavior can be modified at runtime via sysfs.
+4 −0
Original line number Original line Diff line number Diff line
@@ -24,6 +24,10 @@
#define XFS_BUF_LOCK_TRACKING 1
#define XFS_BUF_LOCK_TRACKING 1
#endif
#endif


#ifdef CONFIG_XFS_ASSERT_FATAL
#define XFS_ASSERT_FATAL 1
#endif

#ifdef CONFIG_XFS_WARN
#ifdef CONFIG_XFS_WARN
#define XFS_WARN 1
#define XFS_WARN 1
#endif
#endif
+5 −2
Original line number Original line Diff line number Diff line
@@ -47,6 +47,9 @@ xfs_param_t xfs_params = {


struct xfs_globals xfs_globals = {
struct xfs_globals xfs_globals = {
	.log_recovery_delay	=	0,	/* no delay by default */
	.log_recovery_delay	=	0,	/* no delay by default */
	.bug_on_assert		=	true,	/* historical default in DEBUG
#ifdef XFS_ASSERT_FATAL
						 * mode */
	.bug_on_assert		=	true,	/* assert failures BUG() */
#else
	.bug_on_assert		=	false,	/* assert failures WARN() */
#endif
};
};