Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 115394
b: refs/heads/master
c: 460cdbc
h: refs/heads/master
v: v3
  • Loading branch information
J. Bruce Fields authored and Trond Myklebust committed Oct 7, 2008
1 parent 91d000a commit 94c2a1f
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 13 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 4ada29d5c4dd2d3ba89510bdbc64be22961fd1cb
refs/heads/master: 460cdbc83268dd9641b57d893b03ef52fcc3f96d
17 changes: 5 additions & 12 deletions trunk/fs/nfs/nfs4namespace.c
Original file line number Diff line number Diff line change
Expand Up @@ -116,24 +116,22 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
{
struct vfsmount *mnt = ERR_PTR(-ENOENT);
char *mnt_path;
unsigned int s = 0;
unsigned int s;

mnt_path = nfs4_pathname_string(&location->rootpath, page2, PAGE_SIZE);
if (IS_ERR(mnt_path))
return mnt;
mountdata->mnt_path = mnt_path;

while (s < location->nservers) {
for (s = 0; s < location->nservers; s++) {
struct sockaddr_in addr = {
.sin_family = AF_INET,
.sin_port = htons(NFS_PORT),
};

if (location->servers[s].len <= 0 ||
valid_ipaddr4(location->servers[s].data) < 0) {
s++;
valid_ipaddr4(location->servers[s].data) < 0)
continue;
}

mountdata->hostname = location->servers[s].data;
addr.sin_addr.s_addr = in_aton(mountdata->hostname),
Expand All @@ -147,7 +145,6 @@ static struct vfsmount *try_location(struct nfs_clone_mount *mountdata,
mnt = vfs_kern_mount(&nfs4_referral_fs_type, 0, page, mountdata);
if (!IS_ERR(mnt))
break;
s++;
}
return mnt;
}
Expand Down Expand Up @@ -193,20 +190,16 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
goto out;
}

loc = 0;
while (loc < locations->nlocations) {
for (loc = 0; loc < locations->nlocations; loc++) {
const struct nfs4_fs_location *location = &locations->locations[loc];

if (location == NULL || location->nservers <= 0 ||
location->rootpath.ncomponents == 0) {
loc++;
location->rootpath.ncomponents == 0)
continue;
}

mnt = try_location(&mountdata, page, page2, location);
if (!IS_ERR(mnt))
break;
loc++;
}

out:
Expand Down

0 comments on commit 94c2a1f

Please sign in to comment.