aboutsummaryrefslogtreecommitdiffstats
path: root/fs/nfs
diff options
context:
space:
mode:
authorTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-02 20:41:53 -0500
committerTrond Myklebust <Trond.Myklebust@netapp.com>2007-02-03 18:35:10 -0500
commit588a700b269b785b19d5d03084bee5e1b74c7758 (patch)
tree0b470b4eec5c081c46002b6307852ab3647e9c7f /fs/nfs
parent1d21632d366b33b3adf4fa26144edf3162a9715d (diff)
NFSv4: /proc/mounts displays the wrong server name for referrals
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'fs/nfs')
-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 }