[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Fri, 27 Aug 2021 18:04:32 -0700
From: CGEL <cgel.zte@...il.com>
To: Mark Fasheh <mark@...heh.com>
Cc: Joel Becker <jlbec@...lplan.org>,
Joseph Qi <joseph.qi@...ux.alibaba.com>,
ocfs2-devel@....oracle.com, linux-kernel@...r.kernel.org,
Changcheng Deng <deng.changcheng@....com.cn>,
Zeal Robot <zealci@....com.cn>
Subject: [PATCH linux-next] ocfs2: fix bugon.cocci warnings
From: Changcheng Deng <deng.changcheng@....com.cn>
Use BUG_ON instead of if condition followed by BUG.
Reported-by: Zeal Robot <zealci@....com.cn>
Signed-off-by: Changcheng Deng <deng.changcheng@....com.cn>
---
fs/ocfs2/journal.c | 9 +++------
1 file changed, 3 insertions(+), 6 deletions(-)
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index 4f15750..2305aa5 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -974,8 +974,7 @@ void ocfs2_journal_shutdown(struct ocfs2_super *osb)
goto done;
/* need to inc inode use count - jbd2_journal_destroy will iput. */
- if (!igrab(inode))
- BUG();
+ BUG_ON(!igrab(inode));
num_running_trans = atomic_read(&(osb->journal->j_num_trans));
trace_ocfs2_journal_shutdown(num_running_trans);
@@ -1656,8 +1655,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
status = jbd2_journal_load(journal);
if (status < 0) {
mlog_errno(status);
- if (!igrab(inode))
- BUG();
+ BUG_ON(!igrab(inode));
jbd2_journal_destroy(journal);
goto done;
}
@@ -1686,8 +1684,7 @@ static int ocfs2_replay_journal(struct ocfs2_super *osb,
if (status < 0)
mlog_errno(status);
- if (!igrab(inode))
- BUG();
+ BUG_ON(!igrab(inode));
jbd2_journal_destroy(journal);
--
1.8.3.1
Powered by blists - more mailing lists