From patchwork Tue Mar 30 19:51:16 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 49048 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from lists.samba.org (fn.samba.org [216.83.154.106]) by ozlabs.org (Postfix) with ESMTP id 15443B6F11 for ; Wed, 31 Mar 2010 06:51:48 +1100 (EST) Received: from fn.samba.org (localhost [127.0.0.1]) by lists.samba.org (Postfix) with ESMTP id A707DAD276; Tue, 30 Mar 2010 13:51:48 -0600 (MDT) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on fn.samba.org X-Spam-Level: X-Spam-Status: No, score=-9.9 required=3.8 tests=AWL, BAYES_00, RCVD_IN_DNSWL_HI, SPF_HELO_PASS,SPF_NEUTRAL autolearn=ham version=3.2.5 X-Original-To: linux-cifs-client@lists.samba.org Delivered-To: linux-cifs-client@lists.samba.org Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by lists.samba.org (Postfix) with ESMTP id 20461465BA for ; Tue, 30 Mar 2010 13:51:23 -0600 (MDT) Received: from int-mx04.intmail.prod.int.phx2.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.17]) by mx1.redhat.com (8.13.8/8.13.8) with ESMTP id o2UJpLvR032214 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-SHA bits=256 verify=OK); Tue, 30 Mar 2010 15:51:21 -0400 Received: from localhost.localdomain (vpn-10-89.rdu.redhat.com [10.11.10.89]) by int-mx04.intmail.prod.int.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id o2UJp84W024778; Tue, 30 Mar 2010 15:51:20 -0400 From: Jeff Layton To: linux-cifs-client@lists.samba.org Date: Tue, 30 Mar 2010 15:51:16 -0400 Message-Id: <1269978677-6817-15-git-send-email-jlayton@samba.org> In-Reply-To: <1269978677-6817-1-git-send-email-jlayton@samba.org> References: <1269978677-6817-1-git-send-email-jlayton@samba.org> X-Scanned-By: MIMEDefang 2.67 on 10.5.11.17 Cc: linux-fsdevel@vger.kernel.org Subject: [linux-cifs-client] [PATCH 14/15] cifs: add "multises" mount option X-BeenThere: linux-cifs-client@lists.samba.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: The Linux CIFS VFS client List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Sender: linux-cifs-client-bounces@lists.samba.org Errors-To: linux-cifs-client-bounces@lists.samba.org From: Jeff Layton This allows someone to declare a mount as multisession mount. Multisession mounts also imply "noperm" since we want to allow the server to handle permission checking. It also (for now) requires Kerberos authentication. Eventually, we could expand this to other authtypes, but that requires a scheme to allow per-user credential stashing in some form. Signed-off-by: Jeff Layton --- fs/cifs/connect.c | 7 +++++++ 1 files changed, 7 insertions(+), 0 deletions(-) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index b213a9b..9bf590d 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -96,6 +96,7 @@ struct smb_vol { bool noblocksnd:1; bool noautotune:1; bool nostrictsync:1; /* do not force expensive SMBflush on every sync */ + bool multises:1; unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; @@ -1339,6 +1340,9 @@ cifs_parse_mount_options(char *options, const char *devname, printk(KERN_WARNING "CIFS: Mount option noac not " "supported. Instead set " "/proc/fs/cifs/LookupCacheEnabled to 0\n"); + } else if (strnicmp(data, "multises", 8) == 0) { + vol->multises = 1; + vol->secFlg |= CIFSSEC_MAY_KRB5; } else printk(KERN_WARNING "CIFS: Unknown mount option %s\n", data); @@ -2400,6 +2404,9 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_OVERR_GID; if (pvolume_info->dynperm) cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; + if (pvolume_info->multises) + cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTISES | + CIFS_MOUNT_NO_PERM); if (pvolume_info->direct_io) { cFYI(1, ("mounting share using direct i/o")); cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DIRECT_IO;