NFS: Use the NFS_DEFAULT_VERSION for v2 and v3 mounts
Subsystems (2)
PATCH 1/1 NFS: Use the NFS_DEFAULT_VERSION for v2 and v3 mounts
From: Bryan Schumaker <[email protected]>
Older versions of nfs utils don't always pass a "vers=" mount option for NFS. This chould lead to attempts at using NFS v0 due to a zeroed out nfs_parsed_mount_data struct. I solve this by setting the default NFS version to NFS_DEFAULT_VERSION in the v2 and v3 cases (v4 has already been taken care of by a similar patch).
--- fs/nfs/super.c | 1 + 1 file changed, 1 insertion(+)
fs/nfs/super.c +1 -0
@@ -1867,6 +1867,7 @@ static int nfs23_validate_mount_data(void *options,if (data ==NULL ) goto out_no_data; + args->version =NFS_DEFAULT_VERSION ;switch (data->version) {case 1 : data->namlen =0 ;
Signature · 1 line
1.7.10.3
Quoted 9 lines · On Fri, Jun 08, 2012 at 11:32:56AM -0400, [email protected] wrote:
From: Bryan Schumaker <[email protected]>
Older versions of nfs utils don't always pass a "vers=" mount option for NFS. This chould lead to attempts at using NFS v0 due to a zeroed out
nfs_parsed_mount_datastruct. I solve this by setting the default NFS version toNFS_DEFAULT_VERSIONin the v2 and v3 cases (v4 has already been taken care of by a similar patch).Reported-by Joerg Roedel <joro@&bytes.org>
8bytes.org
Quoted 10 lines
Signed-off-by Bryan Schumaker <[email protected]>--- fs/nfs/super.c | 1 + 1 file changed, 1 insertion(+)fs/nfs/super.c +0
-0
fs/nfs/super.c static int nfs23_validate_mount_data(void *options, · line 1873
Quoted 7 lines
fs/nfs/super.c +1
-0@@ -1867,6 +1867,7 @@ static int nfs23_validate_mount_data(void *options,if (data ==NULL ) goto out_no_data; + args->version =NFS_DEFAULT_VERSION ;switch (data->version) {case 1 : data->namlen =0 ;
Hmm, I still think that the revert-patch is a better solution. The data-structure is allocated and initialized in nfs_alloc_parsed_mount_data() so this function is the logical place to also initialize the version-field with a meaningful value.
Regards,
Joerg