From patchwork Mon Jan 30 21:39:32 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovskiy X-Patchwork-Id: 9546119 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id A237A60415 for ; Mon, 30 Jan 2017 21:42:14 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id ACC65283E1 for ; Mon, 30 Jan 2017 21:42:14 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id A1D4B283E7; Mon, 30 Jan 2017 21:42:14 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-6.8 required=2.0 tests=BAYES_00,DKIM_SIGNED, RCVD_IN_DNSWL_HI,T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 7D240283E1 for ; Mon, 30 Jan 2017 21:42:13 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754460AbdA3VmM (ORCPT ); Mon, 30 Jan 2017 16:42:12 -0500 Received: from mail-bn3nam01on0137.outbound.protection.outlook.com ([104.47.33.137]:1106 "EHLO NAM01-BN3-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754363AbdA3VmF (ORCPT ); Mon, 30 Jan 2017 16:42:05 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=selector1; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version; bh=HYak8vX11ppvB8zBZm7azen2jBqx6s0aYoLYfJF2dAQ=; b=NcvHC7m5nsVXGgbfwujyu6+2ddL2zUvS1Rm1qFB2ADCmuQeqC5TWaE8WqMhPD0MOISB0aftf6DCNh8JnSEW6HOH6XL/r8bCtHrsEDvIg9Sd4X1XhMCYK35hxfUNPjE0piiaTt+eM/diK9oNZzX1J3NT0FkhW2KHUbMIHRgzetvg= Authentication-Results: spf=none (sender IP is ) smtp.mailfrom=pshilov@microsoft.com; Received: from ubuntu-vm.corp.microsoft.com (2001:4898:80e8:b::63b) by BN6PR03MB2545.namprd03.prod.outlook.com (10.173.142.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_CBC_SHA384_P384) id 15.1.874.12; Mon, 30 Jan 2017 21:39:55 +0000 From: Pavel Shilovsky To: Subject: [PATCH v2 03/15] CIFS: Make send_cancel take rqst as argument Date: Mon, 30 Jan 2017 13:39:32 -0800 Message-ID: <1485812384-28870-4-git-send-email-pshilov@microsoft.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1485812384-28870-1-git-send-email-pshilov@microsoft.com> References: <1485812384-28870-1-git-send-email-pshilov@microsoft.com> MIME-Version: 1.0 X-Originating-IP: [2001:4898:80e8:b::63b] X-ClientProxiedBy: BN6PR1401CA0011.namprd14.prod.outlook.com (10.174.237.149) To BN6PR03MB2545.namprd03.prod.outlook.com (10.173.142.148) X-MS-Office365-Filtering-Correlation-Id: 4aa64dd5-1769-40ad-149d-08d449588801 X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR03MB2545; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2545; 3:uYTYi/zyAULHUTmrWWp03lSIN2K2XzQEdFSLkyiEc83lxFhuXlWhX0UfBbJ6ph1uDX/N/lcBTB2xKd4cjLK3GG1AgVm9cr9IA3gwP3KNQfP7c7zqlVzfdeIQeHQz5+Z8IuI64XA0Gt1Yr61+qtUCdbagDmi5D47b22I4UkxQdq+FBf9nZgdEAwr/3vM2MoZiVOkI86Qx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eZAdeCILw0reKpQmfb8JDgCCfq5OQDKqorotydSGxF63QBkOvtkFJpK+AFtmP/bWgLnWBtiMFHzDoRNw9rK38fv+s6b0wl7A==; 20:rbZPFbaum9TMmZBwsM+LufpzKR39/qSnVWpRl/lnx8gmOThoCsAgIzj6MuNcB+d8CFWiZq5sx+tS0C9IzAQyOn2zjgA4nqpf678A3nlJE4g36pvCjXyhlK3tSviTIKusrq2dXZ7zVbr4oSBVX82hm0oEzTy4CbgBN1/aWMKrjTZ1b7u4bLfbMQsiqt6GfU+ngU8EfNH+iDRSWg1ymjlpfi43u5PVQ6JPeuxJ2l9zB7poFwA+U/BpreNLcs2g/sFIn30g0NA5I4nOqiAPOghOK0AiEOEJMwlwZ/dCcWR954BpKGzZaWq3ibG7Rt7a73a3J+5pvpK60KQ2Q7xqxLlZJPl3VYBkjjbDtemyw0TTiDIjOz04+dHgXOvtWO7jPz98P3hQABxBUKQX6aIe2f8o5J6EPyj2cdau8B95pIx56wZFxQ4xHTaLbHH5D3QL9kzQ2bP+sn1jACoi6KYRfkyqqeeocKhoZo24eAqbB42UE9opFZaOakfoHxBvtL6CqCj/ X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:(158342451672863); X-Exchange-Antispam-Report-CFA-Test: BCL:0; PCL:0; RULEID:(6040375)(601004)(2401047)(5005006)(8121501046)(3002001)(10201501046)(6055026)(6041248)(20161123555025)(20161123564025)(20161123562025)(20161123560025)(6072148)(6047074); SRVR:BN6PR03MB2545; BCL:0; PCL:0; RULEID:; SRVR:BN6PR03MB2545; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2545; 4:VFBjkZghk/CRXm49EH4DhqQuvZDfQ9l+xXS65rMV9wf+z0Inml0YLPCiAG/YAxfa7PLSPgawzbk9mh4dJlIZefhlrLdmz3ULmqZl/PHXeUmfa6vl6AEEec9J0XiZLMIWU00gw24p9mCCCM1IJ9NQolj5PJ7xAdBfxstJOaXNk9zUXgUxh5IzW5l72ZKlxDs8jaO36Cm3M2AfsHSfdFtiZjAr7LL4F36UChNVgSa7ostDZNybmZt848TCR7EtzdciOktSzBZgTb3u3o3UblU1Z0SOjOReDfAVb8MMiMXvRlcxTsJ/kEsfp8ooAapwrt65vEoe/dYB1lJmo0Jy8zwJsHNzWsKzUtgBhvtjLnoboqnK7gbkSdwdHCaPdVxi1VUviXSlSQpv8udoX95lLeZakRsBHYhy4fDfZDdjLE1y5WzaXHSp6boRfb6KkDPe4XG5j56PuDjrCh1ES2dDYljigWpgwyNLXCO8IsSjgkXW1V2Y+v1BaJdW3EWZGT282PZNpLmw9zAb6Tc60vzP6vew4OBWwR1dUKmOPP3WhtTE/R3OH73cBLSyRlXgD4KL9uWSEy1xRtm43bWD6yze99mnnaR855DTn50strGKhMYabgbxovrgO/doT5LuFn1d+xFiVaVbkovV45CZcC1A8YOIJMyB8jtlaBrMLmWlvpKrpvc= X-Forefront-PRVS: 0203C93D51 X-Forefront-Antispam-Report: SFV:NSPM; SFS:(10019020)(4630300001)(6009001)(7916002)(39450400003)(39410400002)(39840400002)(39860400002)(39850400002)(189002)(199003)(86612001)(38730400001)(25786008)(6916009)(6666003)(106356001)(2950100002)(189998001)(50986999)(76176999)(86362001)(50226002)(105586002)(68736007)(107886002)(97736004)(2906002)(450100001)(6486002)(53936002)(101416001)(42186005)(8676002)(5660300001)(81166006)(305945005)(50466002)(81156014)(48376002)(5003940100001)(6116002)(36756003)(2351001)(92566002)(10290500002)(110136003)(7736002)(10090500001)(33646002)(47776003)(5005710100001); DIR:OUT; SFP:1102; SCL:1; SRVR:BN6PR03MB2545; H:ubuntu-vm.corp.microsoft.com; FPR:; SPF:None; PTR:InfoNoRecords; MX:1; A:1; LANG:en; Received-SPF: None (protection.outlook.com: microsoft.com does not designate permitted sender hosts) X-Microsoft-Exchange-Diagnostics: =?us-ascii?Q?1; BN6PR03MB2545; 23:O5wyhn3eoTP/GVEiRkFFDH4juWghJ/UR5kbxdgmvn?= =?us-ascii?Q?URtNxHwKz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GOTkVNWVGf?= =?us-ascii?Q?eHMeaPzih63fTj8yCx7renVM1NUMXayifdmeL3KmVc/0fSK7MFnK5wrIY+34?= =?us-ascii?Q?DxQe/X28dAh/mKc+D2Mc6FVFUHNpbbsR2wbiffOQf2q466b6yWltxQHGzaZ8?= =?us-ascii?Q?xTTXAqbjYBn3laXK45dEFgdk/9Ip5yJrlc/DqGk0f7brZgB95m5uAnjp/EHa?= =?us-ascii?Q?BK3n+fSFnUIy4l3gy/J6kSJB6yY7iUybtJNVehm5WxnIw0/V9GP6AWukuIFT?= =?us-ascii?Q?5uilVs/0+S2Axx+slLz7tJldwo+7l0K+S5vwHjoT7+y/83mWg15f5Ty/uhGV?= =?us-ascii?Q?n+ngfBqKeXS3+NRuLceACeI2nPy89ZpmUmoRXbA?= X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2545; 6:/KVLiXF55sOglIFQtAmRD3X5i8yENcOF7zty3IqDzPg6r1VC0SBKJgK6dI+C+z9bfoOoJK6omy5zK7EVea6nURT1NI8FoRBzniZKhwf0rsE6QEnqSU/ED4nYb/z0isEEOde4MDwdRCvfesVYE69Wvpp0YuTkx2UBa236XdTSemP+fKIZ6UUPGqCWz1ADvmOPuoBaeumnC+gdP9WVSya5g8rfGOIlKoG4zFBryS70tGXItCk6x6feX+RRiedduQdU/kbq0ElSfDA5Qu5Ip448pTLWstMS2hB7LTagyqI3LUlTz11IOhLEIWAV/0OB2+CYggHCj6C8aY9DmtEpnadKmv65XdBhXykxDGOYNOlWCyF7U9DWOdP8skO4VX/02FjPezeVrjJkYlvrcgyJGaoG9pGEOy31MljSRgYNLee81It2b7n5LcRrJPklgPepXa4p; 5:fzGt/vUTkvALOmVgcxup1Az4MgMCO5H5y0X32LP7iyxjyBsPgUK3xaiksES+gvXSwQrMgk+ISTPA0JqJlRWZnKC5fZU3W7tAQRJYrGTGtKr67ET7xjN9O1ipUe9PGqDa/gZgC6dR+Q3UDYAprrPSemyUizAtRAdY5Pf68fVLcfE=; 24:Xp6pujZ2/E6dmrpGYCx4Rc7m5fCpd9RhwuRZ6gwrnWs8at481HrpOp3Kx+73pcKehkkYjllhtl05DHS6Qo0umsUOOohT2ifr/JdFnij9dbs= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2545; 7:rgvpedNLD6KVB687pY66CfkZMZVJxwDSxjEtC37mwuMxROs7SoK/AawAp7IH0yWFF8O/lgFA5vPsZVL2l7ZCIyzee2/rLb0YArDJWurcdZ5XuvyHZ80i+qSplIIKSjtN/H5PZOHwTkZB/ObZaZkehZZUUqGKwuvWFr1x/dHOevoM6ffDNQxK0BNEdHh0Ib9C2T+lX5oeyF65eY/euvJBzu3lHpvIxOBXeopTPVebXdPgDJi6Q1MRImFalxb8nffoOj9K9CrfEp/B8DkcLtBA+uf2qbH5U6M9BvHwzJd9QIc2TbFlj4U4bXsJiYULP5rC/CC3wUSX2XYTkp9rraCwsxzbExacUR6ayR52WjRO9bSlT89D3jSUF9d/+xCV1Uh5Z6X+vofgLj9r4IIxi9Q9yPM3sHaIlrP2CswlQlHuintFmN4VF/QLqxTiO1WVYlJV5h36peaBr2Vee1+SJO1Ozg== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2017 21:39:55.1242 (UTC) X-MS-Exchange-CrossTenant-FromEntityHeader: Hosted X-MS-Exchange-Transport-CrossTenantHeadersStamped: BN6PR03MB2545 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsglob.h | 2 +- fs/cifs/smb1ops.c | 4 ++-- fs/cifs/transport.c | 33 +++++++++++++++++++-------------- 3 files changed, 22 insertions(+), 17 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 59ab5a2..4f4fffd 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -208,7 +208,7 @@ struct cifsInodeInfo; struct cifs_open_parms; struct smb_version_operations { - int (*send_cancel)(struct TCP_Server_Info *, void *, + int (*send_cancel)(struct TCP_Server_Info *, struct smb_rqst *, struct mid_q_entry *); bool (*compare_fids)(struct cifsFileInfo *, struct cifsFileInfo *); /* setup request: allocate mid, sign message */ diff --git a/fs/cifs/smb1ops.c b/fs/cifs/smb1ops.c index fc537c2..67a987e 100644 --- a/fs/cifs/smb1ops.c +++ b/fs/cifs/smb1ops.c @@ -36,11 +36,11 @@ * SMB_COM_NT_CANCEL request and then sends it. */ static int -send_nt_cancel(struct TCP_Server_Info *server, void *buf, +send_nt_cancel(struct TCP_Server_Info *server, struct smb_rqst *rqst, struct mid_q_entry *mid) { int rc = 0; - struct smb_hdr *in_buf = (struct smb_hdr *)buf; + struct smb_hdr *in_buf = (struct smb_hdr *)rqst->rq_iov[0].iov_base; /* -4 for RFC1001 length and +2 for BCC field */ in_buf->smb_buf_length = cpu_to_be32(sizeof(struct smb_hdr) - 4 + 2); diff --git a/fs/cifs/transport.c b/fs/cifs/transport.c index b9fad50..d59ebd0 100644 --- a/fs/cifs/transport.c +++ b/fs/cifs/transport.c @@ -595,10 +595,11 @@ cifs_sync_mid_result(struct mid_q_entry *mid, struct TCP_Server_Info *server) } static inline int -send_cancel(struct TCP_Server_Info *server, void *buf, struct mid_q_entry *mid) +send_cancel(struct TCP_Server_Info *server, struct smb_rqst *rqst, + struct mid_q_entry *mid) { return server->ops->send_cancel ? - server->ops->send_cancel(server, buf, mid) : 0; + server->ops->send_cancel(server, rqst, mid) : 0; } int @@ -718,7 +719,7 @@ SendReceive2(const unsigned int xid, struct cifs_ses *ses, rc = wait_for_response(ses->server, midQ); if (rc != 0) { - send_cancel(ses->server, buf, midQ); + send_cancel(ses->server, &rqst, midQ); spin_lock(&GlobalMid_Lock); if (midQ->mid_state == MID_REQUEST_SUBMITTED) { midQ->callback = DeleteMidQEntry; @@ -771,6 +772,9 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, { int rc = 0; struct mid_q_entry *midQ; + unsigned int len = be32_to_cpu(in_buf->smb_buf_length); + struct kvec iov = { .iov_base = in_buf, .iov_len = len }; + struct smb_rqst rqst = { .rq_iov = &iov, .rq_nvec = 1 }; if (ses == NULL) { cifs_dbg(VFS, "Null smb session\n"); @@ -788,10 +792,9 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, to the same server. We may make this configurable later or use ses->maxReq */ - if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize + - MAX_CIFS_HDR_SIZE - 4) { + if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { cifs_dbg(VFS, "Illegal length, greater than maximum frame, %d\n", - be32_to_cpu(in_buf->smb_buf_length)); + len); return -EIO; } @@ -822,7 +825,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, midQ->mid_state = MID_REQUEST_SUBMITTED; cifs_in_send_inc(ses->server); - rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); + rc = smb_send(ses->server, in_buf, len); cifs_in_send_dec(ses->server); cifs_save_when_sent(midQ); @@ -839,7 +842,7 @@ SendReceive(const unsigned int xid, struct cifs_ses *ses, rc = wait_for_response(ses->server, midQ); if (rc != 0) { - send_cancel(ses->server, in_buf, midQ); + send_cancel(ses->server, &rqst, midQ); spin_lock(&GlobalMid_Lock); if (midQ->mid_state == MID_REQUEST_SUBMITTED) { /* no longer considered to be "in-flight" */ @@ -908,6 +911,9 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, int rstart = 0; struct mid_q_entry *midQ; struct cifs_ses *ses; + unsigned int len = be32_to_cpu(in_buf->smb_buf_length); + struct kvec iov = { .iov_base = in_buf, .iov_len = len }; + struct smb_rqst rqst = { .rq_iov = &iov, .rq_nvec = 1 }; if (tcon == NULL || tcon->ses == NULL) { cifs_dbg(VFS, "Null smb session\n"); @@ -927,10 +933,9 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, to the same server. We may make this configurable later or use ses->maxReq */ - if (be32_to_cpu(in_buf->smb_buf_length) > CIFSMaxBufSize + - MAX_CIFS_HDR_SIZE - 4) { + if (len > CIFSMaxBufSize + MAX_CIFS_HDR_SIZE - 4) { cifs_dbg(VFS, "Illegal length, greater than maximum frame, %d\n", - be32_to_cpu(in_buf->smb_buf_length)); + len); return -EIO; } @@ -959,7 +964,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, midQ->mid_state = MID_REQUEST_SUBMITTED; cifs_in_send_inc(ses->server); - rc = smb_send(ses->server, in_buf, be32_to_cpu(in_buf->smb_buf_length)); + rc = smb_send(ses->server, in_buf, len); cifs_in_send_dec(ses->server); cifs_save_when_sent(midQ); @@ -988,7 +993,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, if (in_buf->Command == SMB_COM_TRANSACTION2) { /* POSIX lock. We send a NT_CANCEL SMB to cause the blocking lock to return. */ - rc = send_cancel(ses->server, in_buf, midQ); + rc = send_cancel(ses->server, &rqst, midQ); if (rc) { cifs_delete_mid(midQ); return rc; @@ -1009,7 +1014,7 @@ SendReceiveBlockingLock(const unsigned int xid, struct cifs_tcon *tcon, rc = wait_for_response(ses->server, midQ); if (rc) { - send_cancel(ses->server, in_buf, midQ); + send_cancel(ses->server, &rqst, midQ); spin_lock(&GlobalMid_Lock); if (midQ->mid_state == MID_REQUEST_SUBMITTED) { /* no longer considered to be "in-flight" */