ocfs2-devel.lists.linux.dev archive mirror
 help / color / mirror / Atom feed
From: Joseph Qi <joseph.qi@linux.alibaba.com>
To: CGEL <cgel.zte@gmail.com>, Mark Fasheh <mark@fasheh.com>,
	akpm <akpm@linux-foundation.org>
Cc: Yury Norov <yury.norov@gmail.com>,
	Jing Yangyang <jing.yangyang@zte.com.cn>,
	Masahiro Yamada <masahiroy@kernel.org>,
	linux-kernel@vger.kernel.org, Zeal Robot <zealci@zte.com.cn>,
	ocfs2-devel@oss.oracle.com
Subject: Re: [Ocfs2-devel] [PATCH linux-next] fs/ocfs2/dlm/dlmmaster.c: fix bugon.cocci warnings
Date: Wed, 25 Aug 2021 16:27:28 +0800	[thread overview]
Message-ID: <6c5bc597-8ab8-ab7e-6005-656660e9a17a@linux.alibaba.com> (raw)
In-Reply-To: <20210825063125.70192-1-deng.changcheng@zte.com.cn>



On 8/25/21 2:31 PM, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@zte.com.cn>
> 
> Use BUG_ON instead of a if condition followed by BUG.
> 
> Generated by: scripts/coccinelle/misc/bugon.cocci
> 
> Reported-by: Zeal Robot <zealci@zte.com.cn>
> Signed-off-by: Jing Yangyang <jing.yangyang@zte.com.cn>

Acked-by: Joseph Qi <joseph.qi@linux.alibaba.com>

> ---
>  fs/ocfs2/dlm/dlmmaster.c | 6 ++----
>  1 file changed, 2 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/ocfs2/dlm/dlmmaster.c b/fs/ocfs2/dlm/dlmmaster.c
> index 227da5b..afaf9a7 100644
> --- a/fs/ocfs2/dlm/dlmmaster.c
> +++ b/fs/ocfs2/dlm/dlmmaster.c
> @@ -2181,8 +2181,7 @@ static int dlm_pre_master_reco_lockres(struct dlm_ctxt *dlm,
>  		ret = dlm_do_master_requery(dlm, res, nodenum, &master);
>  		if (ret < 0) {
>  			mlog_errno(ret);
> -			if (!dlm_is_host_down(ret))
> -				BUG();
> +			BUG_ON(!dlm_is_host_down(ret));
>  			/* host is down, so answer for that node would be
>  			 * DLM_LOCK_RES_OWNER_UNKNOWN.  continue. */
>  			ret = 0;
> @@ -2238,8 +2237,7 @@ int dlm_drop_lockres_ref(struct dlm_ctxt *dlm, struct dlm_lock_resource *res)
>  		mlog(ML_ERROR, "%s: res %.*s, DEREF to node %u got %d\n",
>  		     dlm->name, namelen, lockname, res->owner, r);
>  		dlm_print_one_lock_resource(res);
> -		if (r == -ENOMEM)
> -			BUG();
> +		BUG_ON(r == -ENOMEM);
>  	} else
>  		ret = r;
>  
> 

_______________________________________________
Ocfs2-devel mailing list
Ocfs2-devel@oss.oracle.com
https://oss.oracle.com/mailman/listinfo/ocfs2-devel

      reply	other threads:[~2021-08-25  8:30 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2021-08-25  6:31 [Ocfs2-devel] [PATCH linux-next] fs/ocfs2/dlm/dlmmaster.c: fix bugon.cocci warnings CGEL
2021-08-25  8:27 ` Joseph Qi [this message]

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=6c5bc597-8ab8-ab7e-6005-656660e9a17a@linux.alibaba.com \
    --to=joseph.qi@linux.alibaba.com \
    --cc=akpm@linux-foundation.org \
    --cc=cgel.zte@gmail.com \
    --cc=jing.yangyang@zte.com.cn \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mark@fasheh.com \
    --cc=masahiroy@kernel.org \
    --cc=ocfs2-devel@oss.oracle.com \
    --cc=yury.norov@gmail.com \
    --cc=zealci@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;
as well as URLs for NNTP newsgroup(s).