diff mbox

mount.nfs: Fix auto protocol negotiation

Message ID 20180410142952.10657-1-steved@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve Dickson April 10, 2018, 2:29 p.m. UTC
Commit 71b807e1 introduce a regression that
caused v3 not to be tried when v4 was not
supported by the server during auto negation.

A check of the type in nfs_nfs_version() was
reverted back to only check for the "nfs4"
string not the "nfs" string which fixed the
problem.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 utils/mount/network.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Steve Dickson April 11, 2018, 2:18 p.m. UTC | #1
On 04/10/2018 10:29 AM, Steve Dickson wrote:
> Commit 71b807e1 introduce a regression that
> caused v3 not to be tried when v4 was not
> supported by the server during auto negation.
> 
> A check of the type in nfs_nfs_version() was
> reverted back to only check for the "nfs4"
> string not the "nfs" string which fixed the
> problem.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... 

steved.

> ---
>  utils/mount/network.c | 4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff --git a/utils/mount/network.c b/utils/mount/network.c
> index 9a2c878..e490399 100644
> --- a/utils/mount/network.c
> +++ b/utils/mount/network.c
> @@ -1279,8 +1279,8 @@ nfs_nfs_version(char *type, struct mount_options *options, struct nfs_version *v
>  		}
>  	}
>  
> -	if (!found && strncmp(type, "nfs", 3) == 0)
> -		version_val = "4";
> +	if (!found && strcmp(type, "nfs4") == 0)
> +		version_val = type + 3;
>  	else if (!found)
>  		return 1;
>  	else if (i <= 2 ) {
> 
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 9a2c878..e490399 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1279,8 +1279,8 @@  nfs_nfs_version(char *type, struct mount_options *options, struct nfs_version *v
 		}
 	}
 
-	if (!found && strncmp(type, "nfs", 3) == 0)
-		version_val = "4";
+	if (!found && strcmp(type, "nfs4") == 0)
+		version_val = type + 3;
 	else if (!found)
 		return 1;
 	else if (i <= 2 ) {