Skip to content

Commit

Permalink
NFS: cache parsed auth_info in nfs_server
Browse files Browse the repository at this point in the history
Cache the auth_info structure in nfs_server and pass these values to submounts.

This lays the groundwork for supporting multiple sec= options.

Signed-off-by: Weston Andros Adamson <dros@netapp.com>
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
  • Loading branch information
Weston Andros Adamson authored and Trond Myklebust committed Oct 28, 2013
1 parent a3f73c2 commit 0f5f49b
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 2 deletions.
2 changes: 2 additions & 0 deletions fs/nfs/client.c
Original file line number Diff line number Diff line change
Expand Up @@ -786,6 +786,7 @@ static int nfs_init_server(struct nfs_server *server,
goto error;

server->port = data->nfs_server.port;
server->auth_info = data->auth_info;

error = nfs_init_server_rpcclient(server, &timeparms,
data->selected_flavor);
Expand Down Expand Up @@ -929,6 +930,7 @@ void nfs_server_copy_userdata(struct nfs_server *target, struct nfs_server *sour
target->acdirmax = source->acdirmax;
target->caps = source->caps;
target->options = source->options;
target->auth_info = source->auth_info;
}
EXPORT_SYMBOL_GPL(nfs_server_copy_userdata);

Expand Down
1 change: 1 addition & 0 deletions fs/nfs/nfs4client.c
Original file line number Diff line number Diff line change
Expand Up @@ -962,6 +962,7 @@ static int nfs4_init_server(struct nfs_server *server,
/* Initialise the client representation from the mount data */
server->flags = data->flags;
server->options = data->options;
server->auth_info = data->auth_info;

if (data->auth_info.flavor_len >= 1)
data->selected_flavor = data->auth_info.flavors[0];
Expand Down
3 changes: 1 addition & 2 deletions fs/nfs/super.c
Original file line number Diff line number Diff line change
Expand Up @@ -2187,8 +2187,7 @@ nfs_remount(struct super_block *sb, int *flags, char *raw_data)
data->wsize = nfss->wsize;
data->retrans = nfss->client->cl_timeout->to_retries;
data->selected_flavor = nfss->client->cl_auth->au_flavor;
data->auth_info.flavors[0] = nfss->client->cl_auth->au_flavor;
data->auth_info.flavor_len = 1;
data->auth_info = nfss->auth_info;
data->acregmin = nfss->acregmin / HZ;
data->acregmax = nfss->acregmax / HZ;
data->acdirmin = nfss->acdirmin / HZ;
Expand Down
1 change: 1 addition & 0 deletions include/linux/nfs_fs_sb.h
Original file line number Diff line number Diff line change
Expand Up @@ -151,6 +151,7 @@ struct nfs_server {
unsigned long mount_time; /* when this fs was mounted */
struct super_block *super; /* VFS super block */
dev_t s_dev; /* superblock dev numbers */
struct nfs_auth_info auth_info; /* parsed auth flavors */

#ifdef CONFIG_NFS_FSCACHE
struct nfs_fscache_key *fscache_key; /* unique key for superblock */
Expand Down

0 comments on commit 0f5f49b

Please sign in to comment.