diff options
author | Bryan Schumaker <bjschuma@netapp.com> | 2012-04-27 13:27:42 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2012-04-27 14:10:03 -0400 |
commit | 7e6eb683d260d9325f0d1bd911518d5ed3cb4f0c (patch) | |
tree | 51b22645b2e55cff65acf9feb0d9f43f44ed70d3 /fs/nfs | |
parent | f05d147f7e3cf0d86b3a4bd5603029a7cb109633 (diff) |
NFS: Honor the authflavor set in the clone mount data
The authflavor is set in an nfs_clone_mount structure and passed to the
xdev_mount() functions where it was promptly ignored. Instead, use it
to initialize an rpc_clnt for the cloned server.
Signed-off-by: Bryan Schumaker <bjschuma@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-rw-r--r-- | fs/nfs/client.c | 5 | ||||
-rw-r--r-- | fs/nfs/internal.h | 3 | ||||
-rw-r--r-- | fs/nfs/namespace.c | 3 | ||||
-rw-r--r-- | fs/nfs/super.c | 4 |
4 files changed, 8 insertions, 7 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index da7b5e4ff9ec..60f7e4ec842c 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1729,7 +1729,8 @@ error: | |||
1729 | */ | 1729 | */ |
1730 | struct nfs_server *nfs_clone_server(struct nfs_server *source, | 1730 | struct nfs_server *nfs_clone_server(struct nfs_server *source, |
1731 | struct nfs_fh *fh, | 1731 | struct nfs_fh *fh, |
1732 | struct nfs_fattr *fattr) | 1732 | struct nfs_fattr *fattr, |
1733 | rpc_authflavor_t flavor) | ||
1733 | { | 1734 | { |
1734 | struct nfs_server *server; | 1735 | struct nfs_server *server; |
1735 | struct nfs_fattr *fattr_fsinfo; | 1736 | struct nfs_fattr *fattr_fsinfo; |
@@ -1758,7 +1759,7 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source, | |||
1758 | 1759 | ||
1759 | error = nfs_init_server_rpcclient(server, | 1760 | error = nfs_init_server_rpcclient(server, |
1760 | source->client->cl_timeout, | 1761 | source->client->cl_timeout, |
1761 | source->client->cl_auth->au_flavor); | 1762 | flavor); |
1762 | if (error < 0) | 1763 | if (error < 0) |
1763 | goto out_free_server; | 1764 | goto out_free_server; |
1764 | if (!IS_ERR(source->client_acl)) | 1765 | if (!IS_ERR(source->client_acl)) |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index 49c09b4a535a..b777bdaba4c5 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -165,7 +165,8 @@ extern struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *, | |||
165 | extern void nfs_free_server(struct nfs_server *server); | 165 | extern void nfs_free_server(struct nfs_server *server); |
166 | extern struct nfs_server *nfs_clone_server(struct nfs_server *, | 166 | extern struct nfs_server *nfs_clone_server(struct nfs_server *, |
167 | struct nfs_fh *, | 167 | struct nfs_fh *, |
168 | struct nfs_fattr *); | 168 | struct nfs_fattr *, |
169 | rpc_authflavor_t); | ||
169 | extern void nfs_mark_client_ready(struct nfs_client *clp, int state); | 170 | extern void nfs_mark_client_ready(struct nfs_client *clp, int state); |
170 | extern int nfs4_check_client_ready(struct nfs_client *clp); | 171 | extern int nfs4_check_client_ready(struct nfs_client *clp); |
171 | extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, | 172 | extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp, |
diff --git a/fs/nfs/namespace.c b/fs/nfs/namespace.c index b9a593d056b3..78dde307317f 100644 --- a/fs/nfs/namespace.c +++ b/fs/nfs/namespace.c | |||
@@ -257,7 +257,6 @@ struct vfsmount *nfs_d_automount(struct path *path) | |||
257 | struct nfs_fh *fh = NULL; | 257 | struct nfs_fh *fh = NULL; |
258 | struct nfs_fattr *fattr = NULL; | 258 | struct nfs_fattr *fattr = NULL; |
259 | struct rpc_clnt *client; | 259 | struct rpc_clnt *client; |
260 | rpc_authflavor_t flavor = RPC_AUTH_UNIX; | ||
261 | 260 | ||
262 | dprintk("--> nfs_d_automount()\n"); | 261 | dprintk("--> nfs_d_automount()\n"); |
263 | 262 | ||
@@ -285,7 +284,7 @@ struct vfsmount *nfs_d_automount(struct path *path) | |||
285 | if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) | 284 | if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL) |
286 | mnt = nfs_do_refmount(client, path->dentry); | 285 | mnt = nfs_do_refmount(client, path->dentry); |
287 | else | 286 | else |
288 | mnt = nfs_do_submount(path->dentry, fh, fattr, flavor); | 287 | mnt = nfs_do_submount(path->dentry, fh, fattr, client->cl_auth->au_flavor); |
289 | rpc_shutdown_client(client); | 288 | rpc_shutdown_client(client); |
290 | 289 | ||
291 | if (IS_ERR(mnt)) | 290 | if (IS_ERR(mnt)) |
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 1e6715f0616c..4ac7fca7e4bf 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2428,7 +2428,7 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags, | |||
2428 | dprintk("--> nfs_xdev_mount()\n"); | 2428 | dprintk("--> nfs_xdev_mount()\n"); |
2429 | 2429 | ||
2430 | /* create a new volume representation */ | 2430 | /* create a new volume representation */ |
2431 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr); | 2431 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); |
2432 | if (IS_ERR(server)) { | 2432 | if (IS_ERR(server)) { |
2433 | error = PTR_ERR(server); | 2433 | error = PTR_ERR(server); |
2434 | goto out_err_noserver; | 2434 | goto out_err_noserver; |
@@ -2955,7 +2955,7 @@ nfs4_xdev_mount(struct file_system_type *fs_type, int flags, | |||
2955 | dprintk("--> nfs4_xdev_mount()\n"); | 2955 | dprintk("--> nfs4_xdev_mount()\n"); |
2956 | 2956 | ||
2957 | /* create a new volume representation */ | 2957 | /* create a new volume representation */ |
2958 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr); | 2958 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); |
2959 | if (IS_ERR(server)) { | 2959 | if (IS_ERR(server)) { |
2960 | error = PTR_ERR(server); | 2960 | error = PTR_ERR(server); |
2961 | goto out_err_noserver; | 2961 | goto out_err_noserver; |