From patchwork Fri Oct 18 19:15:18 2013 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Weston Andros Adamson X-Patchwork-Id: 3069671 Return-Path: X-Original-To: patchwork-linux-nfs@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 1BE0DBF924 for ; Fri, 18 Oct 2013 19:15:51 +0000 (UTC) Received: from mail.kernel.org (localhost [127.0.0.1]) by mail.kernel.org (Postfix) with ESMTP id 2179620459 for ; Fri, 18 Oct 2013 19:15:50 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 41210203E9 for ; Fri, 18 Oct 2013 19:15:49 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1756736Ab3JRTPs (ORCPT ); Fri, 18 Oct 2013 15:15:48 -0400 Received: from mx11.netapp.com ([216.240.18.76]:51129 "EHLO mx11.netapp.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753926Ab3JRTPr (ORCPT ); Fri, 18 Oct 2013 15:15:47 -0400 X-IronPort-AV: E=Sophos;i="4.93,524,1378882800"; d="scan'208";a="61770142" Received: from vmwexceht05-prd.hq.netapp.com ([10.106.77.35]) by mx11-out.netapp.com with ESMTP; 18 Oct 2013 12:15:47 -0700 Received: from smtp1.corp.netapp.com (10.57.156.124) by VMWEXCEHT05-PRD.hq.netapp.com (10.106.77.35) with Microsoft SMTP Server id 14.3.123.3; Fri, 18 Oct 2013 12:15:38 -0700 Received: from vpn2ntap-64744.vpn.netapp.com (vpn2ntap-64744.vpn.netapp.com [10.55.69.84]) by smtp1.corp.netapp.com (8.13.1/8.13.1/NTAP-1.6) with ESMTP id r9IJFPgF015058; Fri, 18 Oct 2013 12:15:33 -0700 (PDT) From: Weston Andros Adamson To: CC: , Weston Andros Adamson Subject: [PATCH 4/5] NFS: stop using NFS_MOUNT_SECFLAVOUR server flag Date: Fri, 18 Oct 2013 15:15:18 -0400 Message-ID: <1382123719-25194-5-git-send-email-dros@netapp.com> X-Mailer: git-send-email 1.7.12.4 (Apple Git-37) In-Reply-To: <1382123719-25194-1-git-send-email-dros@netapp.com> References: <1382123719-25194-1-git-send-email-dros@netapp.com> MIME-Version: 1.0 Sender: linux-nfs-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org X-Spam-Status: No, score=-7.3 required=5.0 tests=BAYES_00, RCVD_IN_DNSWL_HI, 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 Since the parsed sec= flavor is now stored in nfs_server->auth_info, we no longer need an nfs_server flag to determine if a sec= option was used. This flag has not been completely removed because it is still needed for the (old but still supported) non-text parsed mount options ABI compatability. Signed-off-by: Weston Andros Adamson --- fs/nfs/nfs4client.c | 6 ++++-- fs/nfs/nfs4namespace.c | 2 +- fs/nfs/nfs4proc.c | 4 ++-- fs/nfs/super.c | 3 +-- include/uapi/linux/nfs_mount.h | 2 +- 5 files changed, 9 insertions(+), 8 deletions(-) diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c index 73899c0..0697ef3 100644 --- a/fs/nfs/nfs4client.c +++ b/fs/nfs/nfs4client.c @@ -1050,6 +1050,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, { struct nfs_client *parent_client; struct nfs_server *server, *parent_server; + bool auth_probe; int error; dprintk("--> nfs4_create_referral_server()\n"); @@ -1082,8 +1083,9 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, if (error < 0) goto error; - error = nfs4_server_common_setup(server, mntfh, - !(parent_server->flags & NFS_MOUNT_SECFLAVOUR)); + auth_probe = parent_server->auth_info.flavor_len < 1; + + error = nfs4_server_common_setup(server, mntfh, auth_probe); if (error < 0) goto error; diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index 62ed517..2d79be2 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c @@ -390,7 +390,7 @@ struct vfsmount *nfs4_submount(struct nfs_server *server, struct dentry *dentry, if (client->cl_auth->au_flavor != flavor) flavor = client->cl_auth->au_flavor; - else if (!(server->flags & NFS_MOUNT_SECFLAVOUR)) { + else if (server->auth_info.flavor_len == 0) { rpc_authflavor_t new = nfs4_negotiate_security(dir, name); if ((int)new >= 0) flavor = new; diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c index d2b4845..9e0c10e 100644 --- a/fs/nfs/nfs4proc.c +++ b/fs/nfs/nfs4proc.c @@ -2911,7 +2911,7 @@ int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle, if (status != -NFS4ERR_WRONGSEC) break; /* Did user force a 'sec=' mount option? */ - if (server->flags & NFS_MOUNT_SECFLAVOUR) + if (server->auth_info.flavor_len > 0) break; default: status = nfs4_do_find_root_sec(server, fhandle, info); @@ -3166,7 +3166,7 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir, if (client != *clnt) goto out; /* No security negotiation if the user specified 'sec=' */ - if (NFS_SERVER(dir)->flags & NFS_MOUNT_SECFLAVOUR) + if (NFS_SERVER(dir)->auth_info.flavor_len > 0) goto out; client = nfs4_create_sec_client(client, dir, name); if (IS_ERR(client)) diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 6c38c2a..1f5b29b 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c @@ -1067,7 +1067,6 @@ static int nfs_parse_security_flavors(char *value, return 0; } - mnt->flags |= NFS_MOUNT_SECFLAVOUR; mnt->auth_info.flavors[0] = pseudoflavor; mnt->auth_info.flavor_len = 1; return 1; @@ -2328,7 +2327,7 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n goto Ebusy; if (a->acdirmax != b->acdirmax) goto Ebusy; - if (b->flags & NFS_MOUNT_SECFLAVOUR && + if (b->auth_info.flavor_len > 0 && clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor) goto Ebusy; return 1; diff --git a/include/uapi/linux/nfs_mount.h b/include/uapi/linux/nfs_mount.h index 576bddd..64b0f22 100644 --- a/include/uapi/linux/nfs_mount.h +++ b/include/uapi/linux/nfs_mount.h @@ -60,7 +60,7 @@ struct nfs_mount_data { #define NFS_MOUNT_BROKEN_SUID 0x0400 /* 4 */ #define NFS_MOUNT_NOACL 0x0800 /* 4 */ #define NFS_MOUNT_STRICTLOCK 0x1000 /* reserved for NFSv4 */ -#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 */ +#define NFS_MOUNT_SECFLAVOUR 0x2000 /* 5 non-text parsed mount data only */ #define NFS_MOUNT_NORDIRPLUS 0x4000 /* 5 */ #define NFS_MOUNT_UNSHARED 0x8000 /* 5 */ #define NFS_MOUNT_FLAGMASK 0xFFFF