From patchwork Wed Oct 2 02:29:57 2019 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 1170420 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Authentication-Results: ozlabs.org; spf=none (mailfrom) smtp.mailfrom=vger.kernel.org (client-ip=209.132.180.67; helo=vger.kernel.org; envelope-from=linux-cifs-owner@vger.kernel.org; receiver=) Authentication-Results: ozlabs.org; dmarc=pass (p=none dis=none) header.from=gmail.com Authentication-Results: ozlabs.org; dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.b="o1VFHMjz"; dkim-atps=neutral Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by ozlabs.org (Postfix) with ESMTP id 46jg8h1SrNz9s4Y for ; Wed, 2 Oct 2019 12:30:11 +1000 (AEST) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726184AbfJBCaJ (ORCPT ); Tue, 1 Oct 2019 22:30:09 -0400 Received: from mail-io1-f51.google.com ([209.85.166.51]:44538 "EHLO mail-io1-f51.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726062AbfJBCaJ (ORCPT ); Tue, 1 Oct 2019 22:30:09 -0400 Received: by mail-io1-f51.google.com with SMTP id w12so25254397iol.11 for ; Tue, 01 Oct 2019 19:30:09 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:from:date:message-id:subject:to; bh=igvbDSEnc5xtHS7c+cMc3cTpOIKK/QoLC7DTfC7XNXA=; b=o1VFHMjzP/C+dN2PUeIns7ZrTPkJOyPlCZHI123wkBa5jBO6JBc/Bw/8NOC9YagxmE 7Afw+i4MfMUqFOx+KIIwFXGz4t2Rw/3sg00I+kDg3VKTGe/74M+Va8ev6Z6VomFxQhRL oFGARLkNCXGsc7quGSLwymTCQC9JQzEl5xVeKdPchFLdRKWlqz8wggq6bbl6MARHCN2L pIhpQHYD7YCmoHBCUFoAQTJjbRW8JVUiaKpLk0vyxhmSXyvKBap5L5/20I51Hy9HBEyB 1SCn9jzxvPMbWJXF1eElSL2xXEhtOVXESAoV1lfTNeO7m0XuplX/476YaQe6pPYIxnlj 1weg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:from:date:message-id:subject:to; bh=igvbDSEnc5xtHS7c+cMc3cTpOIKK/QoLC7DTfC7XNXA=; b=I/EkwS3cogXhsSJpfJ0xQltX8zbH63RpS8zg3jy9XoHWiZNyCX3eXwFHnyg4Bo1tD2 PiTRmUc+O9hd8wRdXjuidt+Ts4Y0EgpqmyLRyV3qD6XPr8JOZrpzKf+kqzoSsEbNLUqN jlq/ZCKP2J05LZZoJP17eTfpZAJ9jXPR8TWKPwaqbcaW+MNJoF6rLTb++CKlajX96Cqy LQqJYqJ6/dnR6s3ANJi2HyGTSy6HWv5LdYp0hoVs6qRoLVS9QDYZLXCYj8auCroe30Ik S7S6HrEZPLgB5rbzDMWLaREm+3xDwnR84pbfdXUWJ5WniPZjeUrnYhMxsJ9H8+JrMOhj R2VQ== X-Gm-Message-State: APjAAAUrj3GUEmwoj5YcTlXgjgoxBd0q09tauFi7kdF0ckElDWDRgIcb xgyZrRB2lIcTNKnrneXhfkWqBD1XQjrSmQYrz0yPb7eg X-Google-Smtp-Source: APXvYqwa9MLywqy5ZJG1tSWNQWsnlg5J4GPsdZxSbhiaQQPH6b7kyVKCzYJIWCSDEVntluWy1ctPCYJ6ncuzYBqC6Zo= X-Received: by 2002:a92:c00d:: with SMTP id q13mr1443473ild.169.1569983407912; Tue, 01 Oct 2019 19:30:07 -0700 (PDT) MIME-Version: 1.0 From: Steve French Date: Tue, 1 Oct 2019 21:29:57 -0500 Message-ID: Subject: [PATCH][SMB3] cleanup a couple minor recent endian errors spotted by sparse To: CIFS Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org Now that I can run sparse again, spotted two recent minor endian errors that it flagged. From 4c968d8cabdb543cfff3e280a1cc204976f666dd Mon Sep 17 00:00:00 2001 From: Steve French Date: Tue, 1 Oct 2019 21:25:46 -0500 Subject: [PATCH] smb3: cleanup some recent endian errors spotted by updated sparse Now that sparse has been fixed, it spotted a couple recent minor endian errors (and removed one additional sparse warning). Thanks to Luc Van Oostenryck for his help fixing sparse. Signed-off-by: Steve French --- fs/cifs/connect.c | 2 +- fs/cifs/smb2pdu.c | 3 ++- fs/cifs/smb2proto.h | 4 ++++ 3 files changed, 7 insertions(+), 2 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 2850c3ce4391..b724227b853c 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -4264,7 +4264,7 @@ static int mount_get_conns(struct smb_vol *vol, struct cifs_sb_info *cifs_sb, server->ops->qfs_tcon(*xid, tcon); if (cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RO_CACHE) { if (tcon->fsDevInfo.DeviceCharacteristics & - FILE_READ_ONLY_DEVICE) + cpu_to_le32(FILE_READ_ONLY_DEVICE)) cifs_dbg(VFS, "mounted to read only share\n"); else if ((cifs_sb->mnt_cifs_flags & CIFS_MOUNT_RW_CACHE) == 0) diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 85f9d614d968..fd5f2b4b7582 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -3217,7 +3217,8 @@ SMB2_notify_init(const unsigned int xid, struct smb_rqst *rqst, req->PersistentFileId = persistent_fid; req->VolatileFileId = volatile_fid; - req->OutputBufferLength = SMB2_MAX_BUFFER_SIZE - MAX_SMB2_HDR_SIZE; + req->OutputBufferLength = + cpu_to_le32(SMB2_MAX_BUFFER_SIZE - MAX_SMB2_HDR_SIZE); req->CompletionFilter = cpu_to_le32(completion_filter); if (watch_tree) req->Flags = cpu_to_le16(SMB2_WATCH_TREE); diff --git a/fs/cifs/smb2proto.h b/fs/cifs/smb2proto.h index da3a6d580808..71b2930b8e0b 100644 --- a/fs/cifs/smb2proto.h +++ b/fs/cifs/smb2proto.h @@ -150,6 +150,10 @@ extern int SMB2_ioctl_init(struct cifs_tcon *tcon, struct smb_rqst *rqst, bool is_fsctl, char *in_data, u32 indatalen, __u32 max_response_size); extern void SMB2_ioctl_free(struct smb_rqst *rqst); +extern int SMB2_change_notify(const unsigned int xid, struct cifs_tcon *tcon, + u64 persistent_fid, u64 volatile_fid, bool watch_tree, + u32 completion_filter); + extern int SMB2_close(const unsigned int xid, struct cifs_tcon *tcon, u64 persistent_file_id, u64 volatile_file_id); extern int SMB2_close_flags(const unsigned int xid, struct cifs_tcon *tcon, -- 2.20.1