Skip to content

Commit c5afc8d

Browse files
Bryan SchumakerTrond Myklebust
authored andcommitted
NFS: Use the NFS_DEFAULT_VERSION for v2 and v3 mounts
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). Reported-by: Joerg Roedel <joro@&bytes.org> Signed-off-by: Bryan Schumaker <bjschuma@netapp.com> Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
1 parent 906369e commit c5afc8d

1 file changed

Lines changed: 1 addition & 0 deletions

File tree

‎fs/nfs/super.c‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1867,6 +1867,7 @@ static int nfs23_validate_mount_data(void *options,
18671867
if (data == NULL)
18681868
goto out_no_data;
18691869

1870+
args->version = NFS_DEFAULT_VERSION;
18701871
switch (data->version) {
18711872
case 1:
18721873
data->namlen = 0;

0 commit comments

Comments
 (0)