Received: by 2002:a05:6a10:9848:0:0:0:0 with SMTP id x8csp94487pxf; Tue, 16 Mar 2021 23:38:32 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwmfi+JES7o+vt0S/m5vGFfIKV8O0l13g549NBexsN2jnwcXAtvBtN/2m9TuiJAuEJiMGY5 X-Received: by 2002:a17:906:f9db:: with SMTP id lj27mr34137747ejb.399.1615963111823; Tue, 16 Mar 2021 23:38:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1615963111; cv=none; d=google.com; s=arc-20160816; b=QzhYROGl/l6KV9L2WdF5PaOY1sWqR+Sh03dIrnj/GPnVp7534HpqzPj7cVQWHiW6lr Bqzy32zJ9lFcWdnbYXKNWnpr1ssUUPgaY5c9hD+LPUqQ9eHocgf387vXB1wuSi4+LkUg NHgucmgqu7gO4qt82SM+sEiljIAi4W2SBm0hzBfyjDE7nfET/jonhgcNpN83NDFVviCO AdIi/qYokblh9WRgYjEyb6c+Rdh6W83DHgSPpikSRyLEOGh9MnY2PMn0OUJtkv6bM5tc /3FCEGY6FDECjn4Sm4n64YV0Z+P8Z//KNsktrlKpiyMJlkG74BHBe6DqM+v6KBcS2QHj 8yjQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:message-id:date:subject:cc:to:from; bh=pq6wAPSx9TWswNIS8Kg6JuvJux4XjpMgmVlxpt7RToM=; b=QLX7x15SScLoXBVNLlFE9yaCdd+Y4CccNf50Bu2YA0aF6hxoxf/qj8g/kODFDGRble JS5dvuCmAxyRbcQaN+dU5vt7sFGzoFkY02GJuEfzUhkaSniSDd4ms97GWOo7Zm/hQtKS YoTfRWStfFrTF9QeIa1pL04qfkJBfe0Pgjof+YjPg/UqJwkiPjrFZAA/u69l9F5an6sI 1RAhfIOtUxHo3KI4X5gOhs2eDpYvaUspiejeXy/MoX0kucE71Xm7Uc6MoUKuviEn5v0t sfLkkNOvPcgRYMAxojLO289D5pAV2Z50NlPr5UBW/k/LdbODg9rKPyKHG2s2Z/9NeEIY 8Rtg== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id qk9si16352892ejb.474.2021.03.16.23.38.09; Tue, 16 Mar 2021 23:38:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230026AbhCQGfQ (ORCPT + 99 others); Wed, 17 Mar 2021 02:35:16 -0400 Received: from out30-43.freemail.mail.aliyun.com ([115.124.30.43]:51377 "EHLO out30-43.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230123AbhCQGfG (ORCPT ); Wed, 17 Mar 2021 02:35:06 -0400 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R541e4;CH=green;DM=||false|;DS=||;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e04400;MF=jiapeng.chong@linux.alibaba.com;NM=1;PH=DS;RN=4;SR=0;TI=SMTPD_---0USEL4Xl_1615962899; Received: from j63c13417.sqa.eu95.tbsite.net(mailfrom:jiapeng.chong@linux.alibaba.com fp:SMTPD_---0USEL4Xl_1615962899) by smtp.aliyun-inc.com(127.0.0.1); Wed, 17 Mar 2021 14:35:04 +0800 From: Jiapeng Chong To: viro@zeniv.linux.org.uk Cc: linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, Jiapeng Chong Subject: [PATCH] attr: replace if (cond) BUG() with BUG_ON() Date: Wed, 17 Mar 2021 14:34:59 +0800 Message-Id: <1615962899-77049-1-git-send-email-jiapeng.chong@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Fix the following coccicheck warnings: ./fs/attr.c:349:2-5: WARNING: Use BUG_ON instead of if condition followed by BUG. Reported-by: Abaci Robot Signed-off-by: Jiapeng Chong --- fs/attr.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/fs/attr.c b/fs/attr.c index 87ef39d..43f369e 100644 --- a/fs/attr.c +++ b/fs/attr.c @@ -344,9 +344,7 @@ int notify_change(struct user_namespace *mnt_userns, struct dentry *dentry, * no function will ever call notify_change with both ATTR_MODE and * ATTR_KILL_S*ID set. */ - if ((ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) && - (ia_valid & ATTR_MODE)) - BUG(); + BUG_ON((ia_valid & (ATTR_KILL_SUID|ATTR_KILL_SGID)) && (ia_valid & ATTR_MODE)); if (ia_valid & ATTR_KILL_SUID) { if (mode & S_ISUID) { -- 1.8.3.1