From patchwork Fri Aug 20 19:32:11 2010 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Jeff Layton X-Patchwork-Id: 120684 Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by demeter.kernel.org (8.14.4/8.14.3) with ESMTP id o7KJWpNm020219 for ; Fri, 20 Aug 2010 19:32:52 GMT Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753700Ab0HTTck (ORCPT ); Fri, 20 Aug 2010 15:32:40 -0400 Received: from cdptpa-omtalb.mail.rr.com ([75.180.132.121]:59601 "EHLO cdptpa-omtalb.mail.rr.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753622Ab0HTTcO (ORCPT ); Fri, 20 Aug 2010 15:32:14 -0400 X-Authority-Analysis: v=1.1 cv=me5rXWH8syBwDNiWqu/2VC2FCgr8XoBc7B0xMnaGAgw= c=1 sm=0 a=kMBQrhB74FsA:10 a=ld/erqUjW76FpBUqCqkKeA==:17 a=20KFwNOVAAAA:8 a=_DhavN73BcdG0tczslAA:9 a=NIXBeNOcevs6yCm7VQQA:7 a=Pzy7MVGTL2pC2L_QlDXBlwdxX6cA:4 a=jEp0ucaQiEUA:10 a=ld/erqUjW76FpBUqCqkKeA==:117 X-Cloudmark-Score: 0 X-Originating-IP: 71.70.153.3 Received: from [71.70.153.3] ([71.70.153.3:55300] helo=mail.poochiereds.net) by cdptpa-oedge04.mail.rr.com (envelope-from ) (ecelerity 2.2.2.39 r()) with ESMTP id D2/23-17211-D38DE6C4; Fri, 20 Aug 2010 19:32:13 +0000 Received: by mail.poochiereds.net (Postfix, from userid 4447) id 43E4F58155; Fri, 20 Aug 2010 15:32:12 -0400 (EDT) From: Jeff Layton To: linux-cifs@vger.kernel.org Cc: linux-fsdevel@vger.kernel.org Subject: [PATCH 15/15] cifs: add "multiuser" mount option Date: Fri, 20 Aug 2010 15:32:11 -0400 Message-Id: <1282332731-17444-16-git-send-email-jlayton@redhat.com> X-Mailer: git-send-email 1.7.2.1 In-Reply-To: <1282332731-17444-1-git-send-email-jlayton@redhat.com> References: <1282332731-17444-1-git-send-email-jlayton@redhat.com> Sender: linux-cifs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-cifs@vger.kernel.org X-Greylist: IP, sender and recipient auto-whitelisted, not delayed by milter-greylist-4.2.3 (demeter.kernel.org [140.211.167.41]); Fri, 20 Aug 2010 19:32:52 +0000 (UTC) diff --git a/fs/cifs/connect.c b/fs/cifs/connect.c index da861c1..3ea93f9 100644 --- a/fs/cifs/connect.c +++ b/fs/cifs/connect.c @@ -100,6 +100,7 @@ struct smb_vol { bool noautotune:1; bool nostrictsync:1; /* do not force expensive SMBflush on every sync */ bool fsc:1; /* enable fscache */ + bool multiuser:1; unsigned int rsize; unsigned int wsize; bool sockopt_tcp_nodelay:1; @@ -1346,6 +1347,8 @@ cifs_parse_mount_options(char *options, const char *devname, "/proc/fs/cifs/LookupCacheEnabled to 0\n"); } else if (strnicmp(data, "fsc", 3) == 0) { vol->fsc = true; + } else if (strnicmp(data, "multiuser", 8) == 0) { + vol->multiuser = true; } else printk(KERN_WARNING "CIFS: Unknown mount option %s\n", data); @@ -1377,6 +1380,13 @@ cifs_parse_mount_options(char *options, const char *devname, return 1; } } + + if (vol->multiuser && !(vol->secFlg & CIFSSEC_MAY_KRB5)) { + cERROR(1, "Multiuser mounts currently require krb5 " + "authentication!"); + return 1; + } + if (vol->UNCip == NULL) vol->UNCip = &vol->UNC[2]; @@ -2499,6 +2509,9 @@ static void setup_cifs_sb(struct smb_vol *pvolume_info, cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_DYNPERM; if (pvolume_info->fsc) cifs_sb->mnt_cifs_flags |= CIFS_MOUNT_FSCACHE; + if (pvolume_info->multiuser) + cifs_sb->mnt_cifs_flags |= (CIFS_MOUNT_MULTIUSER | + 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;