NFS: cache parsed auth_info in nfs_server
authorWeston Andros Adamson <dros@netapp.com>
Fri, 18 Oct 2013 19:15:17 +0000 (15:15 -0400)
committerTrond Myklebust <Trond.Myklebust@netapp.com>
Mon, 28 Oct 2013 19:37:43 +0000 (15:37 -0400)
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>
fs/nfs/client.c
fs/nfs/nfs4client.c
fs/nfs/super.c
include/linux/nfs_fs_sb.h

index f5a7f7f9cd591f4f3cac38299c5d5a4298693432..1d09289c8f0e370dd3f45a17a7c077246b23d7da 100644 (file)
@@ -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);
@@ -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);
 
index d65090e5d00fc95e538a4fd0cbddd10d420ca8ec..04131c837f27d84daed4676201b29f3c6be03f1a 100644 (file)
@@ -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];
index b87744fb9dcd6c3ffb2cfa306c02a8ab77d3eb55..de1e5e89c93d15f47d0c8026f69f8db3a71c6207 100644 (file)
@@ -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;
index 186ec496931350a3e07dd79f968210c38a01e128..1150ea41b626723b67720320a23f0810a2ec2be4 100644 (file)
@@ -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 */