aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fs/nfs/nfs4namespace.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index 03a9972fa706..dd5fef20c702 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -131,7 +131,6 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
131 .authflavor = NFS_SB(mnt_parent->mnt_sb)->client->cl_auth->au_flavor, 131 .authflavor = NFS_SB(mnt_parent->mnt_sb)->client->cl_auth->au_flavor,
132 }; 132 };
133 char *page = NULL, *page2 = NULL; 133 char *page = NULL, *page2 = NULL;
134 char *devname;
135 int loc, s, error; 134 int loc, s, error;
136 135
137 if (locations == NULL || locations->nlocations <= 0) 136 if (locations == NULL || locations->nlocations <= 0)
@@ -155,12 +154,6 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
155 goto out; 154 goto out;
156 } 155 }
157 156
158 devname = nfs_devname(mnt_parent, dentry, page, PAGE_SIZE);
159 if (IS_ERR(devname)) {
160 mnt = (struct vfsmount *)devname;
161 goto out;
162 }
163
164 loc = 0; 157 loc = 0;
165 while (loc < locations->nlocations && IS_ERR(mnt)) { 158 while (loc < locations->nlocations && IS_ERR(mnt)) {
166 const struct nfs4_fs_location *location = &locations->locations[loc]; 159 const struct nfs4_fs_location *location = &locations->locations[loc];
@@ -195,7 +188,11 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
195 addr.sin_port = htons(NFS_PORT); 188 addr.sin_port = htons(NFS_PORT);
196 mountdata.addr = &addr; 189 mountdata.addr = &addr;
197 190
198 mnt = vfs_kern_mount(&nfs4_referral_fs_type, 0, devname, &mountdata); 191 snprintf(page, PAGE_SIZE, "%s:%s",
192 mountdata.hostname,
193 mountdata.mnt_path);
194
195 mnt = vfs_kern_mount(&nfs4_referral_fs_type, 0, page, &mountdata);
199 if (!IS_ERR(mnt)) { 196 if (!IS_ERR(mnt)) {
200 break; 197 break;
201 } 198 }