Skip to contentSkip to conversation

mount.nfs: Fix auto protocol negotiation

PATCH In review Steve Dickson 1 participant 2 messages Apr 10, 2018 – Apr 11, 2018

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mount.nfs: Fix auto protocol negotiation

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.

---
 utils/mount/network.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
utils/mount/network.c +2 -2
index 9a2c878..e490399 100644
@@ -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 ) {
Signature · 1 line
2.14.3
#1 lore raw
Quoted 10 lines · Steve Dickson

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.

Committed...

steved.

Quoted 20 lines
---
 utils/mount/network.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
utils/mount/network.c +2 -2
index 9a2c878..e490399 100644
@@ -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 ) {