lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <6c5bc597-8ab8-ab7e-6005-656660e9a17a@linux.alibaba.com>
Date:   Wed, 25 Aug 2021 16:27:28 +0800
From:   Joseph Qi <joseph.qi@...ux.alibaba.com>
To:     CGEL <cgel.zte@...il.com>, Mark Fasheh <mark@...heh.com>,
        akpm <akpm@...ux-foundation.org>
Cc:     Joel Becker <jlbec@...lplan.org>,
        Yury Norov <yury.norov@...il.com>,
        Masahiro Yamada <masahiroy@...nel.org>,
        ocfs2-devel@....oracle.com, linux-kernel@...r.kernel.org,
        Jing Yangyang <jing.yangyang@....com.cn>,
        Zeal Robot <zealci@....com.cn>
Subject: Re: [PATCH linux-next] fs/ocfs2/dlm/dlmmaster.c: fix bugon.cocci
 warnings



On 8/25/21 2:31 PM, CGEL wrote:
> From: Jing Yangyang <jing.yangyang@....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@....com.cn>
> Signed-off-by: Jing Yangyang <jing.yangyang@....com.cn>

Acked-by: Joseph Qi <joseph.qi@...ux.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;
>  
> 

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ