diff options
-rw-r--r-- | fs/nfs/client.c | 4 | ||||
-rw-r--r-- | fs/nfs/internal.h | 3 | ||||
-rw-r--r-- | fs/nfs/nfs4namespace.c | 12 |
3 files changed, 11 insertions, 8 deletions
diff --git a/fs/nfs/client.c b/fs/nfs/client.c index 11380601fc78..ba114faf195f 100644 --- a/fs/nfs/client.c +++ b/fs/nfs/client.c | |||
@@ -1094,8 +1094,8 @@ struct nfs_server *nfs4_create_referral_server(struct nfs_clone_mount *data, | |||
1094 | /* Get a client representation. | 1094 | /* Get a client representation. |
1095 | * Note: NFSv4 always uses TCP, */ | 1095 | * Note: NFSv4 always uses TCP, */ |
1096 | error = nfs4_set_client(server, data->hostname, | 1096 | error = nfs4_set_client(server, data->hostname, |
1097 | (struct sockaddr *)data->addr, | 1097 | data->addr, |
1098 | sizeof(*data->addr), | 1098 | data->addrlen, |
1099 | parent_client->cl_ipaddr, | 1099 | parent_client->cl_ipaddr, |
1100 | data->authflavor, | 1100 | data->authflavor, |
1101 | parent_server->client->cl_xprt->prot, | 1101 | parent_server->client->cl_xprt->prot, |
diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h index c8458b168018..75dd4e252cae 100644 --- a/fs/nfs/internal.h +++ b/fs/nfs/internal.h | |||
@@ -21,7 +21,8 @@ struct nfs_clone_mount { | |||
21 | struct nfs_fattr *fattr; | 21 | struct nfs_fattr *fattr; |
22 | char *hostname; | 22 | char *hostname; |
23 | char *mnt_path; | 23 | char *mnt_path; |
24 | struct sockaddr_in *addr; | 24 | struct sockaddr *addr; |
25 | size_t addrlen; | ||
25 | rpc_authflavor_t authflavor; | 26 | rpc_authflavor_t authflavor; |
26 | }; | 27 | }; |
27 | 28 | ||
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c index bd1b1617905d..5f9ba41ed5bf 100644 --- a/fs/nfs/nfs4namespace.c +++ b/fs/nfs/nfs4namespace.c | |||
@@ -172,7 +172,10 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent, | |||
172 | 172 | ||
173 | s = 0; | 173 | s = 0; |
174 | while (s < location->nservers) { | 174 | while (s < location->nservers) { |
175 | struct sockaddr_in addr = {}; | 175 | struct sockaddr_in addr = { |
176 | .sin_family = AF_INET, | ||
177 | .sin_port = htons(NFS_PORT), | ||
178 | }; | ||
176 | 179 | ||
177 | if (location->servers[s].len <= 0 || | 180 | if (location->servers[s].len <= 0 || |
178 | valid_ipaddr4(location->servers[s].data) < 0) { | 181 | valid_ipaddr4(location->servers[s].data) < 0) { |
@@ -181,10 +184,9 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent, | |||
181 | } | 184 | } |
182 | 185 | ||
183 | mountdata.hostname = location->servers[s].data; | 186 | mountdata.hostname = location->servers[s].data; |
184 | addr.sin_addr.s_addr = in_aton(mountdata.hostname); | 187 | addr.sin_addr.s_addr = in_aton(mountdata.hostname), |
185 | addr.sin_family = AF_INET; | 188 | mountdata.addr = (struct sockaddr *)&addr; |
186 | addr.sin_port = htons(NFS_PORT); | 189 | mountdata.addrlen = sizeof(addr); |
187 | mountdata.addr = &addr; | ||
188 | 190 | ||
189 | snprintf(page, PAGE_SIZE, "%s:%s", | 191 | snprintf(page, PAGE_SIZE, "%s:%s", |
190 | mountdata.hostname, | 192 | mountdata.hostname, |