From patchwork Sat Oct 3 23:53:59 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Steve French X-Patchwork-Id: 7323061 Return-Path: X-Original-To: patchwork-cifs-client@patchwork.kernel.org Delivered-To: patchwork-parsemail@patchwork1.web.kernel.org Received: from mail.kernel.org (mail.kernel.org [198.145.29.136]) by patchwork1.web.kernel.org (Postfix) with ESMTP id 66A449F32B for ; Sun, 4 Oct 2015 04:57:43 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 7C67B206FC for ; Sun, 4 Oct 2015 04:57:42 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 544A2206F8 for ; Sun, 4 Oct 2015 04:57:41 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751153AbbJDE5k (ORCPT ); Sun, 4 Oct 2015 00:57:40 -0400 Received: from mail-oi0-f47.google.com ([209.85.218.47]:33858 "EHLO mail-oi0-f47.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751152AbbJDE5k (ORCPT ); Sun, 4 Oct 2015 00:57:40 -0400 Received: by oiev17 with SMTP id v17so76240045oie.1 for ; Sat, 03 Oct 2015 21:57:39 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20120113; h=from:to:cc:subject:date:message-id; bh=IufKgoeU/SoKRSRpQqOmk1YQSwBEDws8JHbQBB+OoIU=; b=TKqxpj4cDNraMcWbCEPqKr6GJufmreHuXRZDOakEz6J1bH5kOxIIuzBPJpAY0v2YmB vLI3QqnZN5MXw1v35Nj+YgR3jl1nMxeoQWGGEeCoWbj69K14btV03GnqcuhBf+lvibE3 FXOgyooXaLr4mtFrVqfkRKNCFw5g/AyAvxpZogiGcVOx0PGLPoR2syXeaZGVmUtitRq2 qJsSZ7DosT0AM1rWLrZFouFmh9dIXCmw5uy9Qn/2XpBVJAf2OddpmLNwMk9RN+1UccQL 7ShvbJwgP/L0d19yEbCko/nmTGsiaXbYlNfh9c6Q1bIMp7K58PGOwxDKiYniOnq37yFL ieEQ== X-Received: by 10.202.45.9 with SMTP id t9mr13166648oit.75.1443934659532; Sat, 03 Oct 2015 21:57:39 -0700 (PDT) Received: from localhost.localdomain (ip-64-134-151-96.public.wayport.net. [64.134.151.96]) by smtp.gmail.com with ESMTPSA id zr4sm921655obc.20.2015.10.03.21.57.38 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Sat, 03 Oct 2015 21:57:38 -0700 (PDT) From: Steve French To: linux-cifs@vger.kernel.org Cc: Steve French , Steve French Subject: [PATCH 1/4] Add parsing for new mount option controlling persistent handles Date: Sat, 3 Oct 2015 18:53:59 -0500 Message-Id: <1443916442-42466-1-git-send-email-smfrench@gmail.com> X-Mailer: git-send-email 1.9.1 Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Spam-Status: No, score=-5.2 required=5.0 tests=BAYES_00, DATE_IN_PAST_03_06, DKIM_ADSP_CUSTOM_MED,DKIM_SIGNED,FREEMAIL_FROM,RCVD_IN_DNSWL_HI, T_DKIM_INVALID, T_RP_MATCHES_RCVD, 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 "nopersistenthandles" and "persistenthandles" mount options added. The former will not request persistent handles on open even when SMB3 negotiated and Continuous Availability share. The latter will request persistent handles (as long as server notes the capability in protocol negotiation) even if share is not Continuous Availability share. Signed-off-by: Steve French --- fs/cifs/cifsglob.h | 4 +++- fs/cifs/connect.c | 19 +++++++++++++++++++ 2 files changed, 22 insertions(+), 1 deletion(-) diff --git a/fs/cifs/cifsglob.h b/fs/cifs/cifsglob.h index a79e484..221ccfa 100644 --- a/fs/cifs/cifsglob.h +++ b/fs/cifs/cifsglob.h @@ -493,7 +493,9 @@ struct smb_vol { bool mfsymlinks:1; /* use Minshall+French Symlinks */ bool multiuser:1; bool rwpidforward:1; /* pid forward for read/write operations */ - bool nosharesock; + bool nosharesock:1; + bool persistent:1; + bool nopersistent:1; unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index 011f4d8..a16f2f0 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -87,6 +87,7 @@ enum { Opt_sign, Opt_seal, Opt_noac, Opt_fsc, Opt_mfsymlinks, Opt_multiuser, Opt_sloppy, Opt_nosharesock, + Opt_persistent, Opt_nopersistent, /* Mount options which take numeric value */ Opt_backupuid, Opt_backupgid, Opt_uid, @@ -169,6 +170,8 @@ static const match_table_t cifs_mount_option_tokens = { { Opt_multiuser, "multiuser" }, { Opt_sloppy, "sloppy" }, { Opt_nosharesock, "nosharesock" }, + { Opt_persistent, "persistenthandles"}, + { Opt_nopersistent, "nopersistenthandles"}, { Opt_backupuid, "backupuid=%s" }, { Opt_backupgid, "backupgid=%s" }, @@ -1497,6 +1500,22 @@ cifs_parse_mount_options(const char *mountdata, const char *devname, case Opt_nosharesock: vol->nosharesock = true; break; + case Opt_nopersistent: + vol->nopersistent = true; + if (vol->persistent) { + cifs_dbg(VFS, + "persistenthandles mount options conflict\n"); + goto cifs_parse_mount_err; + } + break; + case Opt_persistent: + vol->persistent = true; + if (vol->nopersistent) { + cifs_dbg(VFS, + "persistenthandles mount options conflict\n"); + goto cifs_parse_mount_err; + } + break; /* Numeric Values */ case Opt_backupuid: