From: cgel.zte@gmail.com
To: mark@fasheh.com
Cc: jlbec@evilplan.org, joseph.qi@linux.alibaba.com,
ocfs2-devel@oss.oracle.com, linux-kernel@vger.kernel.org,
Zhang Mingyu <zhang.mingyu@zte.com.cn>,
Zeal Robot <zealci@zte.com.cn>
Subject: [PATCH] ocfs2:Use BUG_ON instead of if condition followed by BUG.
Date: Fri, 5 Nov 2021 01:44:24 +0000 [thread overview]
Message-ID: <20211105014424.75372-1-zhang.mingyu@zte.com.cn> (raw)
From: Zhang Mingyu <zhang.mingyu@zte.com.cn>
This issue was detected with the help of Coccinelle.
Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: Zhang Mingyu <zhang.mingyu@zte.com.cn>
---
fs/ocfs2/journal.c | 6 ++----
1 file 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);
--
2.25.1
next reply other threads:[~2021-11-05 1:44 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-11-05 1:44 cgel.zte [this message]
2021-11-05 1:54 ` Joseph Qi
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20211105014424.75372-1-zhang.mingyu@zte.com.cn \
--to=cgel.zte@gmail.com \
--cc=jlbec@evilplan.org \
--cc=joseph.qi@linux.alibaba.com \
--cc=linux-kernel@vger.kernel.org \
--cc=mark@fasheh.com \
--cc=ocfs2-devel@oss.oracle.com \
--cc=zealci@zte.com.cn \
--cc=zhang.mingyu@zte.com.cn \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
all inboxes | Powered by JetHome®