aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorWeston Andros Adamson <dros@netapp.com>2013-10-18 15:15:18 -0400
committerTrond Myklebust <Trond.Myklebust@netapp.com>2013-10-28 15:37:56 -0400
commit5837f6dfcb00f764976ddc178933e612702cbf54 (patch)
tree76a703b7da70c3c4b7e871e054068d1f3a61207f /fs/nfs
parent0f5f49b8b3593309fd3c3a2080a5fd465afdbe16 (diff)
NFS: stop using NFS_MOUNT_SECFLAVOUR server flag
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 <dros@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r--fs/nfs/nfs4client.c6
-rw-r--r--fs/nfs/nfs4namespace.c2
-rw-r--r--fs/nfs/nfs4proc.c4
-rw-r--r--fs/nfs/super.c3
4 files changed, 8 insertions, 7 deletions
diff --git a/fs/nfs/nfs4client.c b/fs/nfs/nfs4client.c
index 04131c837f27..f6cc77c7d802 100644
--- a/fs/nfs/nfs4client.c
+++ b/fs/nfs/nfs4client.c
@@ -1051,6 +1051,7 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
1051{ 1051{
1052 struct nfs_client *parent_client; 1052 struct nfs_client *parent_client;
1053 struct nfs_server *server, *parent_server; 1053 struct nfs_server *server, *parent_server;
1054 bool auth_probe;
1054 int error; 1055 int error;
1055 1056
1056 dprintk("--> nfs4_create_referral_server()\n"); 1057 dprintk("--> nfs4_create_referral_server()\n");
@@ -1083,8 +1084,9 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
1083 if (error < 0) 1084 if (error < 0)
1084 goto error; 1085 goto error;
1085 1086
1086 error = nfs4_server_common_setup(server, mntfh, 1087 auth_probe = parent_server->auth_info.flavor_len < 1;
1087 !(parent_server->flags & NFS_MOUNT_SECFLAVOUR)); 1088
1089 error = nfs4_server_common_setup(server, mntfh, auth_probe);
1088 if (error < 0) 1090 if (error < 0)
1089 goto error; 1091 goto error;
1090 1092
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index 4ec0eea68fdf..b947054f0ca1 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,
390 390
391 if (client->cl_auth->au_flavor != flavor) 391 if (client->cl_auth->au_flavor != flavor)
392 flavor = client->cl_auth->au_flavor; 392 flavor = client->cl_auth->au_flavor;
393 else if (!(server->flags & NFS_MOUNT_SECFLAVOUR)) { 393 else if (server->auth_info.flavor_len == 0) {
394 rpc_authflavor_t new = nfs4_negotiate_security(dir, name); 394 rpc_authflavor_t new = nfs4_negotiate_security(dir, name);
395 if ((int)new >= 0) 395 if ((int)new >= 0)
396 flavor = new; 396 flavor = new;
diff --git a/fs/nfs/nfs4proc.c b/fs/nfs/nfs4proc.c
index 1463c71b0862..0eb8dc5792da 100644
--- a/fs/nfs/nfs4proc.c
+++ b/fs/nfs/nfs4proc.c
@@ -2920,7 +2920,7 @@ int nfs4_proc_get_rootfh(struct nfs_server *server, struct nfs_fh *fhandle,
2920 if (status != -NFS4ERR_WRONGSEC) 2920 if (status != -NFS4ERR_WRONGSEC)
2921 break; 2921 break;
2922 /* Did user force a 'sec=' mount option? */ 2922 /* Did user force a 'sec=' mount option? */
2923 if (server->flags & NFS_MOUNT_SECFLAVOUR) 2923 if (server->auth_info.flavor_len > 0)
2924 break; 2924 break;
2925 default: 2925 default:
2926 status = nfs4_do_find_root_sec(server, fhandle, info); 2926 status = nfs4_do_find_root_sec(server, fhandle, info);
@@ -3180,7 +3180,7 @@ static int nfs4_proc_lookup_common(struct rpc_clnt **clnt, struct inode *dir,
3180 if (client != *clnt) 3180 if (client != *clnt)
3181 goto out; 3181 goto out;
3182 /* No security negotiation if the user specified 'sec=' */ 3182 /* No security negotiation if the user specified 'sec=' */
3183 if (NFS_SERVER(dir)->flags & NFS_MOUNT_SECFLAVOUR) 3183 if (NFS_SERVER(dir)->auth_info.flavor_len > 0)
3184 goto out; 3184 goto out;
3185 client = nfs4_create_sec_client(client, dir, name); 3185 client = nfs4_create_sec_client(client, dir, name);
3186 if (IS_ERR(client)) 3186 if (IS_ERR(client))
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index de1e5e89c93d..3a4f8bf5e5a5 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -1067,7 +1067,6 @@ static int nfs_parse_security_flavors(char *value,
1067 return 0; 1067 return 0;
1068 } 1068 }
1069 1069
1070 mnt->flags |= NFS_MOUNT_SECFLAVOUR;
1071 mnt->auth_info.flavors[0] = pseudoflavor; 1070 mnt->auth_info.flavors[0] = pseudoflavor;
1072 mnt->auth_info.flavor_len = 1; 1071 mnt->auth_info.flavor_len = 1;
1073 return 1; 1072 return 1;
@@ -2332,7 +2331,7 @@ static int nfs_compare_mount_options(const struct super_block *s, const struct n
2332 goto Ebusy; 2331 goto Ebusy;
2333 if (a->acdirmax != b->acdirmax) 2332 if (a->acdirmax != b->acdirmax)
2334 goto Ebusy; 2333 goto Ebusy;
2335 if (b->flags & NFS_MOUNT_SECFLAVOUR && 2334 if (b->auth_info.flavor_len > 0 &&
2336 clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor) 2335 clnt_a->cl_auth->au_flavor != clnt_b->cl_auth->au_flavor)
2337 goto Ebusy; 2336 goto Ebusy;
2338 return 1; 2337 return 1;