xfs: Use WARN_ON_ONCE rather than BUG for bailout mount-operation
PATCH 1/1 xfs: Use WARN_ON_ONCE rather than BUG 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.
For this reason, using WARN_ON_ONCE rather than BUG can prevent this situation.
--- fs/xfs/xfs_mount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)
fs/xfs/xfs_mount.c +1 -2
@@ -213,8 +213,7 @@ xfs_initialize_perag( goto out_hash_destroy;spin_lock (&mp->m_perag_lock); -if (radix_tree_insert (&mp->m_perag_tree, index, pag)) { -BUG (); +if (WARN_ON_ONCE (radix_tree_insert (&mp->m_perag_tree, index, pag))) {spin_unlock (&mp->m_perag_lock);radix_tree_preload_end (); error = -EEXIST ;
Signature · 1 line
2.6.2
Quoted 15 lines · Austin Kim
If the
CONFIG_BUGis enabled, BUG is executed and then system is crashed. However, the bailout for mount is no longer proceeding.For this reason, using
WARN_ON_ONCErather than BUG can prevent this situation.Signed-off-by Austin Kim <[email protected]>--- fs/xfs/xfs_mount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/xfs/xfs_mount.c +0
-0
fs/xfs/xfs_mount.c xfs_initialize_perag( · line 216
Quoted 6 lines
fs/xfs/xfs_mount.c +1
-2@@ -213,8 +213,7 @@ xfs_initialize_perag( goto out_hash_destroy;spin_lock (&mp->m_perag_lock); -if (radix_tree_insert (&mp->m_perag_tree, index, pag)) { -BUG (); +if (WARN_ON_ONCE (radix_tree_insert (&mp->m_perag_tree, index, pag))) {
Er... please wrap the line at 80 columns.
--D
Quoted 6 lines
fs/xfs/xfs_mount.c +0
-0spin_unlock (&mp->m_perag_lock);radix_tree_preload_end (); error = -EEXIST ;Signature · 1 line
2.6.2
2019년 8월 30일 (금) 오전 9:33, Darrick J. Wong <[email protected]>님이 작성:
Quoted 19 lines · Austin Kim
Quoted 17 lines
If the
CONFIG_BUGis enabled, BUG is executed and then system is crashed. However, the bailout for mount is no longer proceeding.For this reason, using
WARN_ON_ONCErather than BUG can prevent this situation.Signed-off-by Austin Kim <[email protected]>--- fs/xfs/xfs_mount.c | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-)fs/xfs/xfs_mount.c +0
-0@@ -213,8 +213,7 @@ xfs_initialize_perag( goto out_hash_destroy;
Quoted 6 lines
fs/xfs/xfs_mount.c xfs_initialize_perag( · line 216
Quoted 4 lines
fs/xfs/xfs_mount.c +1
-2spin_lock (&mp->m_perag_lock); -if (radix_tree_insert (&mp->m_perag_tree, index, pag)) { -BUG (); +if (WARN_ON_ONCE (radix_tree_insert (&mp->m_perag_tree, index, pag))) {Er... please wrap the line at 80 columns.
Oh..
Let me resend patch soon after wrapping 80 column lines.
Quoted 9 lines
--D
Quoted 6 lines
fs/xfs/xfs_mount.c +0
-1spin_unlock (&mp->m_perag_lock);radix_tree_preload_end (); error = -EEXIST ; --2.6.2