diff options
| -rw-r--r-- | fs/nfs/super.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/fs/nfs/super.c b/fs/nfs/super.c index 29786d3b9326..0343ebcfbbdc 100644 --- a/fs/nfs/super.c +++ b/fs/nfs/super.c | |||
| @@ -728,22 +728,24 @@ static void nfs_umount_begin(struct super_block *sb) | |||
| 728 | unlock_kernel(); | 728 | unlock_kernel(); |
| 729 | } | 729 | } |
| 730 | 730 | ||
| 731 | static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(int flags) | 731 | static struct nfs_parsed_mount_data *nfs_alloc_parsed_mount_data(unsigned int version) |
| 732 | { | 732 | { |
| 733 | struct nfs_parsed_mount_data *data; | 733 | struct nfs_parsed_mount_data *data; |
| 734 | 734 | ||
| 735 | data = kzalloc(sizeof(*data), GFP_KERNEL); | 735 | data = kzalloc(sizeof(*data), GFP_KERNEL); |
| 736 | if (data) { | 736 | if (data) { |
| 737 | data->flags = flags; | ||
| 738 | data->rsize = NFS_MAX_FILE_IO_SIZE; | 737 | data->rsize = NFS_MAX_FILE_IO_SIZE; |
| 739 | data->wsize = NFS_MAX_FILE_IO_SIZE; | 738 | data->wsize = NFS_MAX_FILE_IO_SIZE; |
| 740 | data->acregmin = NFS_DEF_ACREGMIN; | 739 | data->acregmin = NFS_DEF_ACREGMIN; |
| 741 | data->acregmax = NFS_DEF_ACREGMAX; | 740 | data->acregmax = NFS_DEF_ACREGMAX; |
| 742 | data->acdirmin = NFS_DEF_ACDIRMIN; | 741 | data->acdirmin = NFS_DEF_ACDIRMIN; |
| 743 | data->acdirmax = NFS_DEF_ACDIRMAX; | 742 | data->acdirmax = NFS_DEF_ACDIRMAX; |
| 743 | data->mount_server.port = NFS_UNSPEC_PORT; | ||
| 744 | data->nfs_server.port = NFS_UNSPEC_PORT; | 744 | data->nfs_server.port = NFS_UNSPEC_PORT; |
| 745 | data->nfs_server.protocol = XPRT_TRANSPORT_TCP; | ||
| 745 | data->auth_flavors[0] = RPC_AUTH_UNIX; | 746 | data->auth_flavors[0] = RPC_AUTH_UNIX; |
| 746 | data->auth_flavor_len = 1; | 747 | data->auth_flavor_len = 1; |
| 748 | data->version = version; | ||
| 747 | data->minorversion = 0; | 749 | data->minorversion = 0; |
| 748 | } | 750 | } |
| 749 | return data; | 751 | return data; |
| @@ -1711,8 +1713,6 @@ static int nfs_validate_mount_data(void *options, | |||
| 1711 | 1713 | ||
| 1712 | if (!(data->flags & NFS_MOUNT_TCP)) | 1714 | if (!(data->flags & NFS_MOUNT_TCP)) |
| 1713 | args->nfs_server.protocol = XPRT_TRANSPORT_UDP; | 1715 | args->nfs_server.protocol = XPRT_TRANSPORT_UDP; |
| 1714 | else | ||
| 1715 | args->nfs_server.protocol = XPRT_TRANSPORT_TCP; | ||
| 1716 | /* N.B. caller will free nfs_server.hostname in all cases */ | 1716 | /* N.B. caller will free nfs_server.hostname in all cases */ |
| 1717 | args->nfs_server.hostname = kstrdup(data->hostname, GFP_KERNEL); | 1717 | args->nfs_server.hostname = kstrdup(data->hostname, GFP_KERNEL); |
| 1718 | args->namlen = data->namlen; | 1718 | args->namlen = data->namlen; |
| @@ -2106,7 +2106,7 @@ static int nfs_get_sb(struct file_system_type *fs_type, | |||
| 2106 | }; | 2106 | }; |
| 2107 | int error = -ENOMEM; | 2107 | int error = -ENOMEM; |
| 2108 | 2108 | ||
| 2109 | data = nfs_alloc_parsed_mount_data(NFS_MOUNT_VER3 | NFS_MOUNT_TCP); | 2109 | data = nfs_alloc_parsed_mount_data(3); |
| 2110 | mntfh = kzalloc(sizeof(*mntfh), GFP_KERNEL); | 2110 | mntfh = kzalloc(sizeof(*mntfh), GFP_KERNEL); |
| 2111 | if (data == NULL || mntfh == NULL) | 2111 | if (data == NULL || mntfh == NULL) |
| 2112 | goto out_free_fh; | 2112 | goto out_free_fh; |
| @@ -2376,7 +2376,6 @@ static int nfs4_validate_mount_data(void *options, | |||
| 2376 | if (data == NULL) | 2376 | if (data == NULL) |
| 2377 | goto out_no_data; | 2377 | goto out_no_data; |
| 2378 | 2378 | ||
| 2379 | args->version = 4; | ||
| 2380 | switch (data->version) { | 2379 | switch (data->version) { |
| 2381 | case 1: | 2380 | case 1: |
| 2382 | if (data->host_addrlen > sizeof(args->nfs_server.address)) | 2381 | if (data->host_addrlen > sizeof(args->nfs_server.address)) |
| @@ -2660,7 +2659,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type, | |||
| 2660 | struct nfs_parsed_mount_data *data; | 2659 | struct nfs_parsed_mount_data *data; |
| 2661 | int error = -ENOMEM; | 2660 | int error = -ENOMEM; |
| 2662 | 2661 | ||
| 2663 | data = nfs_alloc_parsed_mount_data(0); | 2662 | data = nfs_alloc_parsed_mount_data(4); |
| 2664 | if (data == NULL) | 2663 | if (data == NULL) |
| 2665 | goto out_free_data; | 2664 | goto out_free_data; |
| 2666 | 2665 | ||
