From patchwork Mon Jan 30 21:39:39 2017 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Pavel Shilovskiy X-Patchwork-Id: 9546123 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 66BB0604CC for ; Mon, 30 Jan 2017 21:44:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 72418283F1 for ; Mon, 30 Jan 2017 21:44:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 6712C283F9; Mon, 30 Jan 2017 21:44:00 +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 EA89E283F1 for ; Mon, 30 Jan 2017 21:43:59 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754536AbdA3Vnz (ORCPT ); Mon, 30 Jan 2017 16:43:55 -0500 Received: from mail-by2nam03on0095.outbound.protection.outlook.com ([104.47.42.95]:53632 "EHLO NAM03-BY2-obe.outbound.protection.outlook.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S1754529AbdA3Vnn (ORCPT ); Mon, 30 Jan 2017 16:43:43 -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=XwbBHWMF2ArgVBsW6P5DkFU6DTQw/IUKTDiy1gbzu6I=; b=HHXc+dC4gr9IfufwfYJG9gT1OoISXD1vGDVUkf/z/cVX9hBnSHCUN1WlhpacTNU7/ImtRnDVsa7a6hyb5aZ3UFdeQYa/td2EHpT6BzmuRRWQevqbIVguo5XNU2SvzXKLNKEGBDlQ0ZAj49aBackaOUabtJhExti/6GQdqtawCBs= 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:41:08 +0000 From: Pavel Shilovsky To: Subject: [PATCH v2 10/15] CIFS: Add transform header handling callbacks Date: Mon, 30 Jan 2017 13:39:39 -0800 Message-ID: <1485812384-28870-11-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: 2583a104-88ce-4553-06f3-08d44958b37e X-Microsoft-Antispam: UriScan:; BCL:0; PCL:0; RULEID:(22001); SRVR:BN6PR03MB2545; X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2545; 3:uMJVBd0Qzov5e4zRRzuTrwRh7MXaYxU24XhiRAJ5i7+io0X/9sHT6P9rq2aUNetnRbRSmkEw97IDUwfiBlkLiH1AafWR2ewaHzCYcLRii0R7CYOXnAWstbmSEI/cZ4tJoxVta/nWLmLTbdpa4fe463KXrH6bA/JSMQX7RvXxlSfodv4g3H9ekvw+STkvJ9CsHjVxcmj1a0nmyO4ErX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U/vcsBap/OsE1/88OcxUJeJ0BB3ei7ioGu9fd6bfod9LSd+YtW8jlq4MavRgEekx1GHj7JMFomt/Gw==; 20:617fjbKGLn4WTsA3qKQI4tAcNRsH3sXYudkz07xeSlfw+dKl4+6/6TYHhz3DwCWxz0IszomwCXMqV5o1CEqa5+qtf5pmLe7z/osKqfaWtRyYhGd1H99PaLVOGWBTe/WAnxBNMDFhpqZ746f8ASrGcEGaqLdUAbuqT//4qWbhsK3GuFLKOTzZz0BakTL2T89mY5kAzt/IGpastb0ScGvl55pkovsM12ddyztce5DrejFcgK6hMxvnWdmg0lGcCvR1UVKZpegtxmUlvdWJkTG9hT6zdQbu7aMKuT/UzOtGPd+2FZcneFNAj7rdhJJce9M7Lud2W08FAdGC6QOd/juDMTC2bKE9973Hh1w2yvUptPPUPJD293GDyOoQ9MXN+glXtYRc0Vu+4G3FfqATarIEJ8P3Cwh8ZlxqI7f53p3anvXBHlkciZ//gssFhWUWI/vW/WoNLwW6I5KXtgKgTA6bC6WpvhCoL4L0vRKs0ryyb06FhBeIWn8FfolLiN+Mmr8u X-Microsoft-Antispam-PRVS: X-Exchange-Antispam-Report-Test: UriScan:; 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:YrvqayBLyzHSZmM+iJ5Qix3tplqplhGuRdffFt6jMPdZGqlQmZCftwSiqkceCq67rhSTLS06YOLDsKBpM58fuCU47M4z7/zdPeojl32s3EcyZup6uMeMjhdfIQMsbsWJ+wjVG4l/tUCqnAu4lgluKT8ArpmRn+tYyHNDJuZu3FOWpX4ZiE0ppMpJQCU5zln8x5ke833zCnvF88G/anfCq9lbqbA8ke+CslrGTWzpkHJ6AQ/ngMRoKdvYXpXyvS+vCHOWIQWx5MyPUvTGJbna7rXzLQy1gqiRjYdNeo82+YvKE7i5WNvDyLRncPtFzAfE1DObYAvAPyFFUUQ5i3kr5jG/W8nF13lUSYufvAIKz8ovAGP1e89zCaY2tI28EsSYA480VBKv8atV3KY5a9S2TmETiQvZ2epMa8YWPC7iIg/IWcdQs98VYyp9b4rSV5E6kyIyJchffcGOXiN8OX6PLZbMze69jbjj2g3ZPkT714OknbDCGl9dvcVYOHe2vcNCgwFWOUvpGXdVD59Z6rGrrhKU4g1peoKY6XqgzPjZ9Pt3EmzmTTZ524X0dK7ZxkV3X7vLz0pddVv4uQWU1abR4HVIAg7MQnF4mnPWUfHGYOA= 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:8AgpGMb/A6QwiYJIbqodCPxFbvyB3ZkV2J05HKgkS?= =?us-ascii?Q?IiJuLSG71w2bn4XRF4HVQ4RPawLld6EivdcNNlX2tB8JVlLu0LA200n1BAlz?= =?us-ascii?Q?ju2lEKn+zdRUt14wQ6biaJOy07K+FJ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q2SCR4Xi+oI4idtpEvpnLwtUPPl8W0e6L7ZrNfaU7k0g= SpamDiagnosticOutput: 1:99 SpamDiagnosticMetadata: NSPM X-Microsoft-Exchange-Diagnostics: 1; BN6PR03MB2545; 7:reIgAiA9mwlwJgWaT41/szSCemQMspspq4/GWuYHuwdt3Yba41MfmirMEDsGj9YPldiiU/fTNgHXVrvK0riSDLpenREu/qJm1aG6ljxjFB03f6oZAjndEAw/JKTZRM+H3ID7aTUZ+SLByeZ9kO5pQ4d75nhzO+EzdbMO5lMyrq2HFF3hIxlElO4+bQAK5ROIlP4c3IynFbqfi1MLEEOkselY2ILdj4hF5d+qWt9VajcZ24pObEFTbzjcSxosDCpYSE/3atdDsjAQuaenRuN1G5h8GSsSbwgk6TdbkRsnrvd90JcdTixnnDezFVQJS/fFV5LeAl8jm58VkdZS8UbWE92Ep4q0ezaPeNiGg6IEY1cB0Z4S8dltRVD2tzVwMZHow0ZFPU5nlMWRiZ0cV2rr+O4TNAnQB8DCpngSlWzDH6MtbVeGgkaACSHblucKeLbGoqv4Pifi0kpSdLDZkBjAhQ== X-OriginatorOrg: microsoft.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 30 Jan 2017 21:41:08.1141 (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 We need to recognize and parse transformed packets in demultiplex thread to find a corresponsing mid and process it further. Signed-off-by: Pavel Shilovsky --- fs/cifs/cifsglob.h | 3 +++ fs/cifs/connect.c | 17 ++++++++++++----- 2 files changed, 15 insertions(+), 5 deletions(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index 9433a9b..1d1cdea 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -440,6 +440,9 @@ struct smb_version_operations { struct smb_rqst *); /* free transform request */ void (*free_transform_rq)(struct smb_rqst *); + int (*is_transform_hdr)(void *buf); + int (*receive_transform)(struct TCP_Server_Info *, + struct mid_q_entry **); }; struct smb_version_values { diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 46124a0..3a2183a 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -869,12 +869,19 @@ cifs_demultiplex_thread(void *p) continue; server->total_read += length; - mid_entry = server->ops->find_mid(server, buf); + if (server->ops->is_transform_hdr && + server->ops->receive_transform && + server->ops->is_transform_hdr(buf)) { + length = server->ops->receive_transform(server, + &mid_entry); + } else { + mid_entry = server->ops->find_mid(server, buf); - if (!mid_entry || !mid_entry->receive) - length = standard_receive3(server, mid_entry); - else - length = mid_entry->receive(server, mid_entry); + if (!mid_entry || !mid_entry->receive) + length = standard_receive3(server, mid_entry); + else + length = mid_entry->receive(server, mid_entry); + } if (length < 0) continue;