diff options
Diffstat (limited to 'fs/nfs/super.c')
-rw-r--r-- | fs/nfs/super.c | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 37412f706b32..4ac7fca7e4bf 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
@@ -2428,7 +2428,7 @@ nfs_xdev_mount(struct file_system_type *fs_type, int flags, | |||
2428 | dprintk("--> nfs_xdev_mount()\n"); | 2428 | dprintk("--> nfs_xdev_mount()\n"); |
2429 | 2429 | ||
2430 | /* create a new volume representation */ | 2430 | /* create a new volume representation */ |
2431 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr); | 2431 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); |
2432 | if (IS_ERR(server)) { | 2432 | if (IS_ERR(server)) { |
2433 | error = PTR_ERR(server); | 2433 | error = PTR_ERR(server); |
2434 | goto out_err_noserver; | 2434 | goto out_err_noserver; |
@@ -2767,11 +2767,15 @@ static struct vfsmount *nfs_do_root_mount(struct file_system_type *fs_type, | |||
2767 | char *root_devname; | 2767 | char *root_devname; |
2768 | size_t len; | 2768 | size_t len; |
2769 | 2769 | ||
2770 | len = strlen(hostname) + 3; | 2770 | len = strlen(hostname) + 5; |
2771 | root_devname = kmalloc(len, GFP_KERNEL); | 2771 | root_devname = kmalloc(len, GFP_KERNEL); |
2772 | if (root_devname == NULL) | 2772 | if (root_devname == NULL) |
2773 | return ERR_PTR(-ENOMEM); | 2773 | return ERR_PTR(-ENOMEM); |
2774 | snprintf(root_devname, len, "%s:/", hostname); | 2774 | /* Does hostname needs to be enclosed in brackets? */ |
2775 | if (strchr(hostname, ':')) | ||
2776 | snprintf(root_devname, len, "[%s]:/", hostname); | ||
2777 | else | ||
2778 | snprintf(root_devname, len, "%s:/", hostname); | ||
2775 | root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data); | 2779 | root_mnt = vfs_kern_mount(fs_type, flags, root_devname, data); |
2776 | kfree(root_devname); | 2780 | kfree(root_devname); |
2777 | return root_mnt; | 2781 | return root_mnt; |
@@ -2951,7 +2955,7 @@ nfs4_xdev_mount(struct file_system_type *fs_type, int flags, | |||
2951 | dprintk("--> nfs4_xdev_mount()\n"); | 2955 | dprintk("--> nfs4_xdev_mount()\n"); |
2952 | 2956 | ||
2953 | /* create a new volume representation */ | 2957 | /* create a new volume representation */ |
2954 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr); | 2958 | server = nfs_clone_server(NFS_SB(data->sb), data->fh, data->fattr, data->authflavor); |
2955 | if (IS_ERR(server)) { | 2959 | if (IS_ERR(server)) { |
2956 | error = PTR_ERR(server); | 2960 | error = PTR_ERR(server); |
2957 | goto out_err_noserver; | 2961 | goto out_err_noserver; |