Explorar el Código

NFSv4: /proc/mounts displays the wrong server name for referrals

Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Trond Myklebust hace 18 años
padre
commit
588a700b26
Se han modificado 1 ficheros con 5 adiciones y 8 borrados
  1. 5 8
      fs/nfs/nfs4namespace.c

+ 5 - 8
fs/nfs/nfs4namespace.c

@@ -131,7 +131,6 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
 		.authflavor = NFS_SB(mnt_parent->mnt_sb)->client->cl_auth->au_flavor,
 		.authflavor = NFS_SB(mnt_parent->mnt_sb)->client->cl_auth->au_flavor,
 	};
 	};
 	char *page = NULL, *page2 = NULL;
 	char *page = NULL, *page2 = NULL;
-	char *devname;
 	int loc, s, error;
 	int loc, s, error;
 
 
 	if (locations == NULL || locations->nlocations <= 0)
 	if (locations == NULL || locations->nlocations <= 0)
@@ -155,12 +154,6 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
 		goto out;
 		goto out;
 	}
 	}
 
 
-	devname = nfs_devname(mnt_parent, dentry, page, PAGE_SIZE);
-	if (IS_ERR(devname)) {
-		mnt = (struct vfsmount *)devname;
-		goto out;
-	}
-
 	loc = 0;
 	loc = 0;
 	while (loc < locations->nlocations && IS_ERR(mnt)) {
 	while (loc < locations->nlocations && IS_ERR(mnt)) {
 		const struct nfs4_fs_location *location = &locations->locations[loc];
 		const struct nfs4_fs_location *location = &locations->locations[loc];
@@ -195,7 +188,11 @@ static struct vfsmount *nfs_follow_referral(const struct vfsmount *mnt_parent,
 			addr.sin_port = htons(NFS_PORT);
 			addr.sin_port = htons(NFS_PORT);
 			mountdata.addr = &addr;
 			mountdata.addr = &addr;
 
 
-			mnt = vfs_kern_mount(&nfs4_referral_fs_type, 0, devname, &mountdata);
+			snprintf(page, PAGE_SIZE, "%s:%s",
+					mountdata.hostname,
+					mountdata.mnt_path);
+
+			mnt = vfs_kern_mount(&nfs4_referral_fs_type, 0, page, &mountdata);
 			if (!IS_ERR(mnt)) {
 			if (!IS_ERR(mnt)) {
 				break;
 				break;
 			}
 			}