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.c16
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/nfs/nfs4namespace.c b/fs/nfs/nfs4namespace.c
index b872779d7cd5..dd5fef20c702 100644
--- a/fs/nfs/nfs4namespace.c
+++ b/fs/nfs/nfs4namespace.c
@@ -16,6 +16,7 @@
16#include <linux/vfs.h> 16#include <linux/vfs.h>
17#include <linux/inet.h> 17#include <linux/inet.h>
18#include "internal.h" 18#include "internal.h"
19#include "nfs4_fs.h"
19 20
20#define NFSDBG_FACILITY NFSDBG_VFS 21#define NFSDBG_FACILITY NFSDBG_VFS
21 22
@@ -130,7 +131,6 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
130 .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,
131 }; 132 };
132 char *page = NULL, *page2 = NULL; 133 char *page = NULL, *page2 = NULL;
133 char *devname;
134 int loc, s, error; 134 int loc, s, error;
135 135
136 if (locations == NULL || locations->nlocations <= 0) 136 if (locations == NULL || locations->nlocations <= 0)
@@ -154,12 +154,6 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
154 goto out; 154 goto out;
155 } 155 }
156 156
157 devname = nfs_devname(mnt_parent, dentry, page, PAGE_SIZE);
158 if (IS_ERR(devname)) {
159 mnt = (struct vfsmount *)devname;
160 goto out;
161 }
162
163 loc = 0; 157 loc = 0;
164 while (loc < locations->nlocations && IS_ERR(mnt)) { 158 while (loc < locations->nlocations && IS_ERR(mnt)) {
165 const struct nfs4_fs_location *location = &locations->locations[loc]; 159 const struct nfs4_fs_location *location = &locations->locations[loc];
@@ -194,7 +188,11 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
194 addr.sin_port = htons(NFS_PORT); 188 addr.sin_port = htons(NFS_PORT);
195 mountdata.addr = &addr; 189 mountdata.addr = &addr;
196 190
197 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);
198 if (!IS_ERR(mnt)) { 196 if (!IS_ERR(mnt)) {
199 break; 197 break;
200 } 198 }
@@ -242,7 +240,7 @@ struct vfsmount *nfs_do_refmount(const struct vfsmount *mnt_parent, struct dentr
242 dprintk("%s: getting locations for %s/%s\n", 240 dprintk("%s: getting locations for %s/%s\n",
243 __FUNCTION__, parent->d_name.name, dentry->d_name.name); 241 __FUNCTION__, parent->d_name.name, dentry->d_name.name);
244 242
245 err = nfs4_proc_fs_locations(parent->d_inode, dentry, fs_locations, page); 243 err = nfs4_proc_fs_locations(parent->d_inode, &dentry->d_name, fs_locations, page);
246 dput(parent); 244 dput(parent);
247 if (err != 0 || 245 if (err != 0 ||
248 fs_locations->nlocations <= 0 || 246 fs_locations->nlocations <= 0 ||