From patchwork Fri Sep 11 04:05:35 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Bin X-Patchwork-Id: 11769751 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 440DE13B1 for ; Fri, 11 Sep 2020 03:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 35361221EB for ; Fri, 11 Sep 2020 03:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725300AbgIKD7T (ORCPT ); Thu, 10 Sep 2020 23:59:19 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59536 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725786AbgIKD66 (ORCPT ); Thu, 10 Sep 2020 23:58:58 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 6593F7046D96FD5A979E; Fri, 11 Sep 2020 11:58:54 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 11:58:44 +0800 From: Zheng Bin To: , , , CC: , Subject: [PATCH -next 1/5] cifs: fix comparison to bool warning in cifsacl.c Date: Fri, 11 Sep 2020 12:05:35 +0800 Message-ID: <20200911040539.113307-2-zhengbin13@huawei.com> X-Mailer: git-send-email 2.26.0.106.g9fadedd In-Reply-To: <20200911040539.113307-1-zhengbin13@huawei.com> References: <20200911040539.113307-1-zhengbin13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Fixes coccicheck warning: fs/cifs/cifsacl.c:371:6-49: WARNING: Comparison to bool Signed-off-by: Zheng Bin --- fs/cifs/cifsacl.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.0.106.g9fadedd diff --git a/fs/cifs/cifsacl.c b/fs/cifs/cifsacl.c index fcff14ef1c70..9447ff1a5b6a 100644 --- a/fs/cifs/cifsacl.c +++ b/fs/cifs/cifsacl.c @@ -368,7 +368,7 @@ sid_to_id(struct cifs_sb_info *cifs_sb, struct cifs_sid *psid, else is_group = false; - if (is_well_known_sid(psid, &unix_id, is_group) == false) + if (!is_well_known_sid(psid, &unix_id, is_group)) goto try_upcall_to_get_id; if (is_group) { From patchwork Fri Sep 11 04:05:36 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Bin X-Patchwork-Id: 11769755 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 12EC413B1 for ; Fri, 11 Sep 2020 03:59:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 03A812078D for ; Fri, 11 Sep 2020 03:59:27 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725787AbgIKD66 (ORCPT ); Thu, 10 Sep 2020 23:58:58 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59430 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725780AbgIKD64 (ORCPT ); Thu, 10 Sep 2020 23:58:56 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 53D8CB045BE2E1C82452; Fri, 11 Sep 2020 11:58:54 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 11:58:45 +0800 From: Zheng Bin To: , , , CC: , Subject: [PATCH -next 2/5] cifs: fix comparison to bool warning in file.c Date: Fri, 11 Sep 2020 12:05:36 +0800 Message-ID: <20200911040539.113307-3-zhengbin13@huawei.com> X-Mailer: git-send-email 2.26.0.106.g9fadedd In-Reply-To: <20200911040539.113307-1-zhengbin13@huawei.com> References: <20200911040539.113307-1-zhengbin13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Fixes coccicheck warning: fs/cifs/file.c:780:22-38: WARNING: Comparison to bool Signed-off-by: Zheng Bin --- fs/cifs/file.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.0.106.g9fadedd diff --git a/fs/cifs/file.c b/fs/cifs/file.c index be46fab4c96d..bad749f606d5 100644 --- a/fs/cifs/file.c +++ b/fs/cifs/file.c @@ -777,7 +777,7 @@ cifs_reopen_file(struct cifsFileInfo *cfile, bool can_flush) * not dirty locally we could do this. */ rc = server->ops->open(xid, &oparms, &oplock, NULL); - if (rc == -ENOENT && oparms.reconnect == false) { + if (rc == -ENOENT && !oparms.reconnect) { /* durable handle timeout is expired - open the file again */ rc = server->ops->open(xid, &oparms, &oplock, NULL); /* indicate that we need to relock the file */ From patchwork Fri Sep 11 04:05:37 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Bin X-Patchwork-Id: 11769749 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 2A24D59D for ; Fri, 11 Sep 2020 03:59:20 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A9C9221E5 for ; Fri, 11 Sep 2020 03:59:20 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725795AbgIKD7A (ORCPT ); Thu, 10 Sep 2020 23:59:00 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59396 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725777AbgIKD66 (ORCPT ); Thu, 10 Sep 2020 23:58:58 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 4F1089F4014E2AD9523B; Fri, 11 Sep 2020 11:58:54 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 11:58:45 +0800 From: Zheng Bin To: , , , CC: , Subject: [PATCH -next 3/5] cifs: fix comparison to bool warning in smb2misc.c Date: Fri, 11 Sep 2020 12:05:37 +0800 Message-ID: <20200911040539.113307-4-zhengbin13@huawei.com> X-Mailer: git-send-email 2.26.0.106.g9fadedd In-Reply-To: <20200911040539.113307-1-zhengbin13@huawei.com> References: <20200911040539.113307-1-zhengbin13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Fixes coccicheck warning: fs/cifs/smb2misc.c:416:5-51: WARNING: Comparison to bool Signed-off-by: Zheng Bin --- fs/cifs/smb2misc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) -- 2.26.0.106.g9fadedd diff --git a/fs/cifs/smb2misc.c b/fs/cifs/smb2misc.c index d88e2683626e..0864cfa87834 100644 --- a/fs/cifs/smb2misc.c +++ b/fs/cifs/smb2misc.c @@ -413,7 +413,7 @@ smb2_calc_size(void *buf, struct TCP_Server_Info *srvr) */ len += le16_to_cpu(pdu->StructureSize2); - if (has_smb2_data_area[le16_to_cpu(shdr->Command)] == false) + if (!has_smb2_data_area[le16_to_cpu(shdr->Command)]) goto calc_size_exit; smb2_get_data_area_len(&offset, &data_length, shdr); From patchwork Fri Sep 11 04:05:38 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Bin X-Patchwork-Id: 11769757 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 8690859D for ; Fri, 11 Sep 2020 03:59:28 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 6E4FE221E5 for ; Fri, 11 Sep 2020 03:59:28 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725782AbgIKD65 (ORCPT ); Thu, 10 Sep 2020 23:58:57 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59474 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725283AbgIKD64 (ORCPT ); Thu, 10 Sep 2020 23:58:56 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 60F004CED601D85B6576; Fri, 11 Sep 2020 11:58:54 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 11:58:46 +0800 From: Zheng Bin To: , , , CC: , Subject: [PATCH -next 4/5] cifs: fix comparison to bool warning in connect.c Date: Fri, 11 Sep 2020 12:05:38 +0800 Message-ID: <20200911040539.113307-5-zhengbin13@huawei.com> X-Mailer: git-send-email 2.26.0.106.g9fadedd In-Reply-To: <20200911040539.113307-1-zhengbin13@huawei.com> References: <20200911040539.113307-1-zhengbin13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Fixes coccicheck warning: fs/cifs/connect.c:2478:5-16: WARNING: Comparison to bool fs/cifs/connect.c:3560:10-35: WARNING: Comparison to bool fs/cifs/connect.c:4297:6-21: WARNING: Comparison to bool Signed-off-by: Zheng Bin --- fs/cifs/connect.c | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index a5731dd6e656..4d2651b9f019 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -2475,7 +2475,7 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, else if (override_gid == 1) pr_notice("ignoring forcegid mount option specified with no gid= option\n"); - if (got_version == false) + if (!got_version) pr_warn_once("No dialect specified on mount. Default has changed to a more secure dialect, SMB2.1 or later (e.g. SMB3.1.1), from CIFS (SMB1). To use the less secure SMB1 dialect to access old servers which do not support SMB3.1.1 (or even SMB3 or SMB2.1) specify vers=1.0 on mount.\n"); kfree(mountdata_copy); @@ -3557,7 +3557,7 @@ cifs_get_tcon(struct cifs_ses *ses, struct smb_vol *volume_info) } } else if ((tcon->capabilities & SMB2_SHARE_CAP_CONTINUOUS_AVAILABILITY) && (ses->server->capabilities & SMB2_GLOBAL_CAP_PERSISTENT_HANDLES) - && (volume_info->nopersistent == false)) { + && !volume_info->nopersistent) { cifs_dbg(FYI, "enabling persistent handles\n"); tcon->use_persistent = true; } else if (volume_info->resilient) { @@ -4294,7 +4294,7 @@ static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, *nses = ses; - if ((vol->persistent == true) && (!(ses->server->capabilities & + if (vol->persistent && (!(ses->server->capabilities & SMB2_GLOBAL_CAP_PERSISTENT_HANDLES))) { cifs_server_dbg(VFS, "persistent handles not supported by server\n"); return -EOPNOTSUPP; From patchwork Fri Sep 11 04:05:39 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Zheng Bin X-Patchwork-Id: 11769747 Return-Path: Received: from mail.kernel.org (pdx-korg-mail-1.web.codeaurora.org [172.30.200.123]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 5425459D for ; Fri, 11 Sep 2020 03:59:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 42B982078D for ; Fri, 11 Sep 2020 03:59:00 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1725765AbgIKD66 (ORCPT ); Thu, 10 Sep 2020 23:58:58 -0400 Received: from szxga06-in.huawei.com ([45.249.212.32]:59462 "EHLO huawei.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1725648AbgIKD64 (ORCPT ); Thu, 10 Sep 2020 23:58:56 -0400 Received: from DGGEMS406-HUB.china.huawei.com (unknown [172.30.72.60]) by Forcepoint Email with ESMTP id 581677D1528170FD2269; Fri, 11 Sep 2020 11:58:54 +0800 (CST) Received: from huawei.com (10.90.53.225) by DGGEMS406-HUB.china.huawei.com (10.3.19.206) with Microsoft SMTP Server id 14.3.487.0; Fri, 11 Sep 2020 11:58:46 +0800 From: Zheng Bin To: , , , CC: , Subject: [PATCH -next 5/5] cifs: fix comparison to bool warning in smb2ops.c Date: Fri, 11 Sep 2020 12:05:39 +0800 Message-ID: <20200911040539.113307-6-zhengbin13@huawei.com> X-Mailer: git-send-email 2.26.0.106.g9fadedd In-Reply-To: <20200911040539.113307-1-zhengbin13@huawei.com> References: <20200911040539.113307-1-zhengbin13@huawei.com> MIME-Version: 1.0 X-Originating-IP: [10.90.53.225] X-CFilter-Loop: Reflected Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Fixes coccicheck warning: fs/cifs/smb2ops.c:3199:6-15: WARNING: Comparison to bool fs/cifs/smb2ops.c:3223:5-14: WARNING: Comparison to bool fs/cifs/smb2ops.c:3301:6-15: WARNING: Comparison to bool fs/cifs/smb2ops.c:3311:6-15: WARNING: Comparison to bool fs/cifs/smb2ops.c:3341:6-15: WARNING: Comparison to bool Signed-off-by: Zheng Bin --- fs/cifs/smb2ops.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) -- 2.26.0.106.g9fadedd diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 32f90dc82c84..213a0e3d9f76 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -3196,7 +3196,7 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon, /* if file not oplocked can't be sure whether asking to extend size */ if (!CIFS_CACHE_READ(cifsi)) - if (keep_size == false) { + if (!keep_size) { rc = -EOPNOTSUPP; trace_smb3_zero_err(xid, cfile->fid.persistent_fid, tcon->tid, ses->Suid, offset, len, rc); @@ -3220,7 +3220,7 @@ static long smb3_zero_range(struct file *file, struct cifs_tcon *tcon, /* * do we also need to change the size of the file? */ - if (keep_size == false && i_size_read(inode) < offset + len) { + if (!keep_size && i_size_read(inode) < offset + len) { eof = cpu_to_le64(offset + len); rc = SMB2_set_eof(xid, tcon, cfile->fid.persistent_fid, cfile->fid.volatile_fid, cfile->pid, &eof); @@ -3298,7 +3298,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon, tcon->ses->Suid, off, len); /* if file not oplocked can't be sure whether asking to extend size */ if (!CIFS_CACHE_READ(cifsi)) - if (keep_size == false) { + if (!keep_size) { trace_smb3_falloc_err(xid, cfile->fid.persistent_fid, tcon->tid, tcon->ses->Suid, off, len, rc); free_xid(xid); @@ -3308,7 +3308,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon, /* * Extending the file */ - if ((keep_size == false) && i_size_read(inode) < off + len) { + if (!keep_size && i_size_read(inode) < off + len) { rc = inode_newsize_ok(inode, off + len); if (rc) goto out; @@ -3338,7 +3338,7 @@ static long smb3_simple_falloc(struct file *file, struct cifs_tcon *tcon, goto out; } - if ((keep_size == true) || (i_size_read(inode) >= off + len)) { + if (keep_size || (i_size_read(inode) >= off + len)) { /* * Check if falloc starts within first few pages of file * and ends within a few pages of the end of file to