aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorZhang Mingyu <[email protected]>2022-01-14 14:03:35 -0800
committerLinus Torvalds <[email protected]>2022-01-15 16:30:24 +0200
commit783cc68d6143da3c8bc6322b80abd96640f6066f (patch)
tree9268372ff057567465fc2046a8450c0c5aedd51d
parent9eec1d897139e5de287af5d559a02b811b844d82 (diff)
ocfs2: use BUG_ON instead of if condition followed by BUG.
This issue was detected with the help of Coccinelle. Link: https://lkml.kernel.org/r/[email protected] Signed-off-by: Zhang Mingyu <[email protected]> Reported-by: Zeal Robot <[email protected]> Acked-by: Joseph Qi <[email protected]> Cc: Mark Fasheh <[email protected]> Cc: Joel Becker <[email protected]> Cc: Junxiao Bi <[email protected]> Cc: Changwei Ge <[email protected]> Cc: Gang He <[email protected]> Cc: Jun Piao <[email protected]> Signed-off-by: Andrew Morton <[email protected]> Signed-off-by: Linus Torvalds <[email protected]>
-rw-r--r--fs/ocfs2/journal.c6
1 files changed, 2 insertions, 4 deletions
diff --git a/fs/ocfs2/journal.c b/fs/ocfs2/journal.c
index dbf9b9e97d74..1887a2708709 100644
--- a/fs/ocfs2/journal.c
+++ b/fs/ocfs2/journal.c
@@ -1669,8 +1669,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;
}
@@ -1699,8 +1698,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);