aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs/nfs4namespace.c
diff options
context:
space:
mode:
Diffstat (limited to 'fs/nfs/nfs4namespace.c')
-rw-r--r--fs/nfs/nfs4namespace.c20
1 files changed, 10 insertions, 10 deletions
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index dd5fef20c702..5f9ba41ed5bf 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -114,10 +114,7 @@ static inline int valid_ipaddr4(const char *buf)
114 * nfs_follow_referral - set up mountpoint when hitting a referral on moved error 114 * nfs_follow_referral - set up mountpoint when hitting a referral on moved error
115 * @mnt_parent - mountpoint of parent directory 115 * @mnt_parent - mountpoint of parent directory
116 * @dentry - parent directory 116 * @dentry - parent directory
117 * @fspath - fs path returned in fs_locations 117 * @locations - array of NFSv4 server location information
118 * @mntpath - mount path to new server
119 * @hostname - hostname of new server
120 * @addr - host addr of new server
121 * 118 *
122 */ 119 */
123static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent, 120static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
@@ -131,7 +128,8 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
131 .authflavor = NFS_SB(mnt_parent->mnt_sb)->client->cl_auth->au_flavor, 128 .authflavor = NFS_SB(mnt_parent->mnt_sb)->client->cl_auth->au_flavor,
132 }; 129 };
133 char *page = NULL, *page2 = NULL; 130 char *page = NULL, *page2 = NULL;
134 int loc, s, error; 131 unsigned int s;
132 int loc, error;
135 133
136 if (locations == NULL || locations->nlocations <= 0) 134 if (locations == NULL || locations->nlocations <= 0)
137 goto out; 135 goto out;
@@ -174,7 +172,10 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
174 172
175 s = 0; 173 s = 0;
176 while (s < location->nservers) { 174 while (s < location->nservers) {
177 struct sockaddr_in addr = {}; 175 struct sockaddr_in addr = {
176 .sin_family = AF_INET,
177 .sin_port = htons(NFS_PORT),
178 };
178 179
179 if (location->servers[s].len <= 0 || 180 if (location->servers[s].len <= 0 ||
180 valid_ipaddr4(location->servers[s].data) < 0) { 181 valid_ipaddr4(location->servers[s].data) < 0) {
@@ -183,10 +184,9 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
183 } 184 }
184 185
185 mountdata.hostname = location->servers[s].data; 186 mountdata.hostname = location->servers[s].data;
186 addr.sin_addr.s_addr = in_aton(mountdata.hostname); 187 addr.sin_addr.s_addr = in_aton(mountdata.hostname),
187 addr.sin_family = AF_INET; 188 mountdata.addr = (struct sockaddr *)&addr;
188 addr.sin_port = htons(NFS_PORT); 189 mountdata.addrlen = sizeof(addr);
189 mountdata.addr = &addr;
190 190
191 snprintf(page, PAGE_SIZE, "%s:%s", 191 snprintf(page, PAGE_SIZE, "%s:%s",
192 mountdata.hostname, 192 mountdata.hostname,