From: Austin Kim Date: Fri, 6 Sep 2019 01:08:50 +0000 (-0700) Subject: xfs: Use WARN_ON_ONCE for bailout mount-operation X-Git-Tag: v5.4-rc1~120^2~8 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=eb2e99943c5bd528af67516fbd9db0ad15e61611;p=thirdparty%2Fkernel%2Flinux.git xfs: Use WARN_ON_ONCE for bailout mount-operation If the CONFIG_BUG is enabled, BUG is executed and then system is crashed. However, the bailout for mount is no longer proceeding. Using WARN_ON_ONCE rather than BUG can prevent this situation. Signed-off-by: Austin Kim Reviewed-by: Darrick J. Wong Signed-off-by: Darrick J. Wong --- diff --git a/fs/xfs/xfs_mount.c b/fs/xfs/xfs_mount.c index da50b12ef634a..ba5b6f3b2b88a 100644 --- a/fs/xfs/xfs_mount.c +++ b/fs/xfs/xfs_mount.c @@ -214,7 +214,7 @@ xfs_initialize_perag( spin_lock(&mp->m_perag_lock); if (radix_tree_insert(&mp->m_perag_tree, index, pag)) { - BUG(); + WARN_ON_ONCE(1); spin_unlock(&mp->m_perag_lock); radix_tree_preload_end(); error = -EEXIST;