From patchwork Wed May 14 12:38:35 2014 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 4174421 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork2.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.19.201]) by patchwork2.web.kernel.org (Postfix) with ESMTP id 0DB1DBFF02 for ; Wed, 14 May 2014 12:38:59 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2AFB220340 for ; Wed, 14 May 2014 12:38:58 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 2CB3020306 for ; Wed, 14 May 2014 12:38:57 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1755351AbaENMi4 (ORCPT ); Wed, 14 May 2014 08:38:56 -0400 Received: from mail-qg0-f50.google.com ([209.85.192.50]:36099 "EHLO mail-qg0-f50.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1755317AbaENMi4 (ORCPT ); Wed, 14 May 2014 08:38:56 -0400 Received: by mail-qg0-f50.google.com with SMTP id z60so2636535qgd.37 for ; Wed, 14 May 2014 05:38:55 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=mime-version:from:date:message-id:subject:to:cc:content-type; bh=vuYpuRP1L90aOc++lY51OkxipM3DjGf39tWmwJc/CK8=; b=HRaB5vPE6IBu4myUdwjAO4NUw7eUG1ToafFLz+JVMH18hMxqplhpmeEcZi24vU+Tyn 0HeuI42oGQT4hiTficaJ/yNX8dXMwPIInHUMIYD23bDcnrshLTPOUH2lUtOlOchsQTDK /Ab8nS/PrOkyaxtc6GN8M0JCUcm2wHxhtcyGIspSYxmlA6fT2bCorcVZtrIL1M7X13eF 2X6lAnFs70wo/suQlo3xiP5hOu48ju67eA6euDc5ob9EUVLa5cw8ahxw5X7pVqn0iCDg jzaalKRAONJYrGGzp6c4Vf8ZJI3mDZhWgUP1OYTdnSpTDCgelZk0qL4yrE2mcYiyTf3I tYVw== X-Received: by 10.140.47.167 with SMTP id m36mr5125593qga.21.1400071135350; Wed, 14 May 2014 05:38:55 -0700 (PDT) MIME-Version: 1.0 Received: by 10.140.96.72 with HTTP; Wed, 14 May 2014 05:38:35 -0700 (PDT) From: Steve French Date: Wed, 14 May 2014 14:38:35 +0200 Message-ID: Subject: [CIFS][PATCH] Clarify SMB2/SMB3 create context and add missing ones To: "linux-cifs@vger.kernel.org" Cc: samba-technical Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-7.4 required=5.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, FREEMAIL_FROM, RCVD_IN_DNSWL_HI, RP_MATCHES_RCVD, T_DKIM_INVALID, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on mail.kernel.org X-Virus-Scanned: ClamAV using ClamSMTP From 0042cf22e164f9f38934e994a2811c35251e88c0 Mon Sep 17 00:00:00 2001 From: Steve French Date: Wed, 14 May 2014 05:29:40 -0700 Subject: [PATCH] [CIFS] Clarify SMB2/SMB3 create context and add missing ones Clarify comments for create contexts which we do send, and fix typo in one create context definition and add newer SMB3 create contexts to the list. Signed-off-by: Steve French --- fs/cifs/smb2ops.c | 2 ++ fs/cifs/smb2pdu.c | 2 ++ fs/cifs/smb2pdu.h | 6 +++++- 3 files changed, 9 insertions(+), 1 deletions(-) diff --git a/fs/cifs/smb2ops.c b/fs/cifs/smb2ops.c index 35ddc3e..787844b 100644 --- a/fs/cifs/smb2ops.c +++ b/fs/cifs/smb2ops.c @@ -1047,6 +1047,7 @@ smb2_create_lease_buf(u8 *lease_key, u8 oplock) buf->ccontext.NameOffset = cpu_to_le16(offsetof (struct create_lease, Name)); buf->ccontext.NameLength = cpu_to_le16(4); + /* SMB2_CREATE_REQUEST_LEASE is "RqLs" */ buf->Name[0] = 'R'; buf->Name[1] = 'q'; buf->Name[2] = 'L'; @@ -1073,6 +1074,7 @@ smb3_create_lease_buf(u8 *lease_key, u8 oplock) buf->ccontext.NameOffset = cpu_to_le16(offsetof (struct create_lease_v2, Name)); buf->ccontext.NameLength = cpu_to_le16(4); + /* SMB2_CREATE_REQUEST_LEASE is "RqLs" */ buf->Name[0] = 'R'; buf->Name[1] = 'q'; buf->Name[2] = 'L'; diff --git a/fs/cifs/smb2pdu.c b/fs/cifs/smb2pdu.c index 0feb743..b0037b6 100644 --- a/fs/cifs/smb2pdu.c +++ b/fs/cifs/smb2pdu.c @@ -972,6 +972,7 @@ create_durable_buf(void) buf->ccontext.NameOffset = cpu_to_le16(offsetof (struct create_durable, Name)); buf->ccontext.NameLength = cpu_to_le16(4); + /* SMB2_CREATE_DURABLE_HANDLE_REQUEST is "DHnQ" */ buf->Name[0] = 'D'; buf->Name[1] = 'H'; buf->Name[2] = 'n'; @@ -996,6 +997,7 @@ create_reconnect_durable_buf(struct cifs_fid *fid) buf->ccontext.NameLength = cpu_to_le16(4); buf->Data.Fid.PersistentFileId = fid->persistent_fid; buf->Data.Fid.VolatileFileId = fid->volatile_fid; + /* SMB2_CREATE_DURABLE_HANDLE_RECONNECT is "DHnC" */ buf->Name[0] = 'D'; buf->Name[1] = 'H'; buf->Name[2] = 'n'; diff --git a/fs/cifs/smb2pdu.h b/fs/cifs/smb2pdu.h index 743e11e..69f3595 100644 --- a/fs/cifs/smb2pdu.h +++ b/fs/cifs/smb2pdu.h @@ -435,11 +435,15 @@ struct smb2_tree_disconnect_rsp { #define SMB2_CREATE_SD_BUFFER "SecD" /* security descriptor */ #define SMB2_CREATE_DURABLE_HANDLE_REQUEST "DHnQ" #define SMB2_CREATE_DURABLE_HANDLE_RECONNECT "DHnC" -#define SMB2_CREATE_ALLOCATION_SIZE "AlSi" +#define SMB2_CREATE_ALLOCATION_SIZE "AISi" #define SMB2_CREATE_QUERY_MAXIMAL_ACCESS_REQUEST "MxAc" #define SMB2_CREATE_TIMEWARP_REQUEST "TWrp" #define SMB2_CREATE_QUERY_ON_DISK_ID "QFid" #define SMB2_CREATE_REQUEST_LEASE "RqLs" +#define SMB2_CREATE_DURABLE_HANDLE_REQUEST_V2 "DH2Q" +#define SMB2_CREATE_DURABLE_HANDLE_RECONNECT_V2 "DH2C" +#define SMB2_CREATE_APP_INSTANCE_ID 0x45BCA66AEFA7F74A9008FA462E144D74 +#define SVHDX_OPEN_DEVICE_CONTEXT 0x83CE6F1AD851E0986E34401CC9BCFCE9 struct smb2_create_req { struct smb2_hdr hdr;