Skip to content

Commit

Permalink
NFS: Honor the authflavor set in the clone mount data
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Bryan Schumaker authored and Trond Myklebust committed Apr 27, 2012
1 parent f05d147 commit 7e6eb68
Show file tree
Hide file tree
Showing 4 changed files with 8 additions and 7 deletions.
5 changes: 3 additions & 2 deletions fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -1729,7 +1729,8 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data,
*/
struct nfs_server *nfs_clone_server(struct nfs_server *source,
struct nfs_fh *fh,
struct nfs_fattr *fattr)
struct nfs_fattr *fattr,
rpc_authflavor_t flavor)
{
struct nfs_server *server;
struct nfs_fattr *fattr_fsinfo;
Expand Down Expand Up @@ -1758,7 +1759,7 @@ struct nfs_server *nfs_clone_server(struct nfs_server *source,

error = nfs_init_server_rpcclient(server,
source->client->cl_timeout,
source->client->cl_auth->au_flavor);
flavor);
if (error < 0)
goto out_free_server;
if (!IS_ERR(source->client_acl))
Expand Down
3 changes: 2 additions & 1 deletion fs/nfs/internal.h
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,8 @@ extern struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *,
extern void nfs_free_server(struct nfs_server *server);
extern struct nfs_server *nfs_clone_server(struct nfs_server *,
struct nfs_fh *,
struct nfs_fattr *);
struct nfs_fattr *,
rpc_authflavor_t);
extern void nfs_mark_client_ready(struct nfs_client *clp, int state);
extern int nfs4_check_client_ready(struct nfs_client *clp);
extern struct nfs_client *nfs4_set_ds_client(struct nfs_client* mds_clp,
Expand Down
3 changes: 1 addition & 2 deletions fs/nfs/namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -257,7 +257,6 @@ struct vfsmount *nfs_d_automount(struct path *path)
struct nfs_fh *fh = NULL;
struct nfs_fattr *fattr = NULL;
struct rpc_clnt *client;
rpc_authflavor_t flavor = RPC_AUTH_UNIX;

dprintk("--> nfs_d_automount()\n");

Expand Down Expand Up @@ -285,7 +284,7 @@ struct vfsmount *nfs_d_automount(struct path *path)
if (fattr->valid & NFS_ATTR_FATTR_V4_REFERRAL)
mnt = nfs_do_refmount(client, path->dentry);
else
mnt = nfs_do_submount(path->dentry, fh, fattr, flavor);
mnt = nfs_do_submount(path->dentry, fh, fattr, client->cl_auth->au_flavor);
rpc_shutdown_client(client);

if (IS_ERR(mnt))
Expand Down
4 changes: 2 additions & 2 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2428,7 +2428,7 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags,
dprintk("--> nfs_xdev_mount()\n");

/* create a new volume representation */
server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr);
server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor);
if (IS_ERR(server)) {
error = PTR_ERR(server);
goto out_err_noserver;
Expand Down Expand Up @@ -2955,7 +2955,7 @@ nfs4_xdev_mount(struct file_system_type *fs_type, int flags,
dprintk("--> nfs4_xdev_mount()\n");

/* create a new volume representation */
server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr);
server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor);
if (IS_ERR(server)) {
error = PTR_ERR(server);
goto out_err_noserver;
Expand Down

0 comments on commit 7e6eb68

Please sign in to comment.