diff options
-rw-r--r-- | fs/nfs/client.c | 25 |
1 files changed, 15 insertions, 10 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index e43072bdbb0c..11380601fc78 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -927,15 +927,17 @@ error: | |||
927 | * Set up an NFS4 client | 927 | * Set up an NFS4 client |
928 | */ | 928 | */ |
929 | static int nfs4_set_client(struct nfs_server *server, | 929 | static int nfs4_set_client(struct nfs_server *server, |
930 | const char *hostname, const struct sockaddr_in *addr, | 930 | const char *hostname, |
931 | const struct sockaddr *addr, | ||
932 | const size_t addrlen, | ||
931 | const char *ip_addr, | 933 | const char *ip_addr, |
932 | rpc_authflavor_t authflavour, | 934 | rpc_authflavor_t authflavour, |
933 | int proto, int timeo, int retrans) | 935 | int proto, int timeo, int retrans) |
934 | { | 936 | { |
935 | struct nfs_client_initdata cl_init = { | 937 | struct nfs_client_initdata cl_init = { |
936 | .hostname = hostname, | 938 | .hostname = hostname, |
937 | .addr = (const struct sockaddr *)addr, | 939 | .addr = addr, |
938 | .addrlen = sizeof(*addr), | 940 | .addrlen = addrlen, |
939 | .rpc_ops = &nfs_v4_clientops, | 941 | .rpc_ops = &nfs_v4_clientops, |
940 | }; | 942 | }; |
941 | struct nfs_client *clp; | 943 | struct nfs_client *clp; |
@@ -1015,7 +1017,8 @@ struct nfs_server *nfs4_create_server(const struct nfs_parsed_mount_data *data, | |||
1015 | /* Get a client record */ | 1017 | /* Get a client record */ |
1016 | error = nfs4_set_client(server, | 1018 | error = nfs4_set_client(server, |
1017 | data->nfs_server.hostname, | 1019 | data->nfs_server.hostname, |
1018 | &data->nfs_server.address, | 1020 | (struct sockaddr *)&data->nfs_server.address, |
1021 | sizeof(data->nfs_server.address), | ||
1019 | data->client_address, | 1022 | data->client_address, |
1020 | data->auth_flavors[0], | 1023 | data->auth_flavors[0], |
1021 | data->nfs_server.protocol, | 1024 | data->nfs_server.protocol, |
@@ -1090,12 +1093,14 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, | |||
1090 | 1093 | ||
1091 | /* Get a client representation. | 1094 | /* Get a client representation. |
1092 | * Note: NFSv4 always uses TCP, */ | 1095 | * Note: NFSv4 always uses TCP, */ |
1093 | error = nfs4_set_client(server, data->hostname, data->addr, | 1096 | error = nfs4_set_client(server, data->hostname, |
1094 | parent_client->cl_ipaddr, | 1097 | (struct sockaddr *)data->addr, |
1095 | data->authflavor, | 1098 | sizeof(*data->addr), |
1096 | parent_server->client->cl_xprt->prot, | 1099 | parent_client->cl_ipaddr, |
1097 | parent_client->retrans_timeo, | 1100 | data->authflavor, |
1098 | parent_client->retrans_count); | 1101 | parent_server->client->cl_xprt->prot, |
1102 | parent_client->retrans_timeo, | ||
1103 | parent_client->retrans_count); | ||
1099 | if (error < 0) | 1104 | if (error < 0) |
1100 | goto error; | 1105 | goto error; |
1101 | 1106 | ||