Skip to contentSkip to conversation

mount: make sure mounting nfs with v4,vers=4 and nfsvers=4

PATCH In review Kinglong Mee 3 participants 7 messages Apr 12, 2015 – May 7, 2015

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

PATCH 1/1 mount: make sure mounting nfs with v4,vers=4 and nfsvers=4

When mounting nfs with -ov4, -overs=4 or -onfsvers=4, fail as,

# mount -t nfs -ov4 192.168.31.12:/ /testidr/
mount.nfs: access denied by server while mounting 192.168.31.12:/
Fixes f980298853 "mount.nfs: configurable minor version defaults"
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
utils/mount/stropts.c +3 -9
index df67fac..2ae532e 100644
@@ -108,12 +108,6 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode == V_DEFAULT) {
-		mi->version.v_mode = V_SPECIFIC;
-		return;
-	}
-
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
@@ -121,9 +115,9 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode != V_DEFAULT) {
-		if (mi->version.major == config_default_vers.major)
+	if (mi->version.v_mode == V_GENERAL) {
+		if (config_default_vers.v_mode != V_DEFAULT &&
+		    mi->version.major == config_default_vers.major)
 			mi->version.minor = config_default_vers.minor;
 		return;
 	}
Signature · 1 line
2.3.5
#1 lore raw

Hi Kinglong, I can't seem to figure out how to reproduce your problem, and I don't see show this change fixes it. Your mount is falling back to a v3 attempt without this patch? What's set in nfsmount.conf?

Ben

Quoted 45 lines · Kinglong Mee

When mounting nfs with -ov4, -overs=4 or -onfsvers=4, fail as,

# mount -t nfs -ov4 192.168.31.12:/ /testidr/
mount.nfs: access denied by server while mounting 192.168.31.12:/
Fixes f980298853 "mount.nfs: configurable minor version defaults"
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
utils/mount/stropts.c +3 -10
index df67fac..2ae532e 100644
@@ -108,12 +108,6 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode == V_DEFAULT) {
-		mi->version.v_mode = V_SPECIFIC;
-		return;
-	}
-
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
@@ -121,9 +115,9 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode != V_DEFAULT) {
-		if (mi->version.major == config_default_vers.major)
+	if (mi->version.v_mode == V_GENERAL) {
+		if (config_default_vers.v_mode != V_DEFAULT &&
+		    mi->version.major == config_default_vers.major)
 			mi->version.minor = config_default_vers.minor;
 		return;
 	}
--

2.3.5

#2 lore raw
Quoted 3 lines · Benjamin Coddington

Hi Kinglong, I can't seem to figure out how to reproduce your problem, and I don't see show this change fixes it. Your mount is falling back to a v3 attempt without this patch? What's set in nfsmount.conf?

Sorry for my missing notes for nfsmount.conf.
My nfsmount.conf is default config,
besides [ NFSMount_Global_Options ], others line are commented by "#", Defaultvers isn't set as, "# Defaultvers=4"

thanks,
Kinglong Mee

Quoted 51 lines

Ben

Quoted 45 lines · Kinglong Mee

When mounting nfs with -ov4, -overs=4 or -onfsvers=4, fail as,

# mount -t nfs -ov4 192.168.31.12:/ /testidr/
mount.nfs: access denied by server while mounting 192.168.31.12:/
Fixes f980298853 "mount.nfs: configurable minor version defaults"
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
utils/mount/stropts.c +3 -10
index df67fac..2ae532e 100644
@@ -108,12 +108,6 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode == V_DEFAULT) {
-		mi->version.v_mode = V_SPECIFIC;
-		return;
-	}
-
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
@@ -121,9 +115,9 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode != V_DEFAULT) {
-		if (mi->version.major == config_default_vers.major)
+	if (mi->version.v_mode == V_GENERAL) {
+		if (config_default_vers.v_mode != V_DEFAULT &&
+		    mi->version.major == config_default_vers.major)
 			mi->version.minor = config_default_vers.minor;
 		return;
 	}
--

2.3.5

#3 lore raw
Quoted 5 lines · Kinglong Mee
Quoted 3 lines · Benjamin Coddington

Hi Kinglong, I can't seem to figure out how to reproduce your problem, and I don't see show this change fixes it. Your mount is falling back to a v3 attempt without this patch? What's set in nfsmount.conf?

Quoted 7 lines

Sorry for my missing notes for nfsmount.conf.
My nfsmount.conf is default config,
besides [ NFSMount_Global_Options ], others line are commented by "#", Defaultvers isn't set as, "# Defaultvers=4"

thanks,
Kinglong Mee

Yes, I see the problem now. The version strings were stripped and never
added back in the general case. Thank you. This looks right.

Quoted 53 lines
Quoted 34 lines · Kinglong Mee
Quoted 33 lines

When mounting nfs with -ov4, -overs=4 or -onfsvers=4, fail as,

# mount -t nfs -ov4 192.168.31.12:/ /testidr/
mount.nfs: access denied by server while mounting 192.168.31.12:/
Fixes f980298853 "mount.nfs: configurable minor version defaults"
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
utils/mount/stropts.c +0 -6
index df67fac..2ae532e 100644
@@ -108,12 +108,6 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode == V_DEFAULT) {
-		mi->version.v_mode = V_SPECIFIC;
-		return;
-	}
-
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
@@ -121,9 +115,9 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
Quoted 14 lines
Quoted 10 lines
utils/mount/stropts.c +3 -4
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode != V_DEFAULT) {
-		if (mi->version.major == config_default_vers.major)
+	if (mi->version.v_mode == V_GENERAL) {
+		if (config_default_vers.v_mode != V_DEFAULT &&
+		    mi->version.major == config_default_vers.major)
 			mi->version.minor = config_default_vers.minor;
 		return;
 	}
--
Quoted 3 lines

2.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#4 lore raw
Quoted 12 lines · Benjamin Coddington
Quoted 10 lines · Kinglong Mee
Quoted 3 lines · Benjamin Coddington

Hi Kinglong, I can't seem to figure out how to reproduce your problem, and I don't see show this change fixes it. Your mount is falling back to a v3 attempt without this patch? What's set in nfsmount.conf?

Sorry for my missing notes for nfsmount.conf.
My nfsmount.conf is default config,
besides [ NFSMount_Global_Options ], others line are commented by "#", Defaultvers isn't set as, "# Defaultvers=4"

Quoted 7 lines
Quoted 2 lines

thanks,
Kinglong Mee

Yes, I see the problem now. The version strings were stripped and never
added back in the general case. Thank you. This looks right.

Hello Steve,

What's the status of this patch?

thanks,
Kinglong Mee

Quoted 55 lines
Quoted 54 lines
Quoted 35 lines · Kinglong Mee
Quoted 33 lines

When mounting nfs with -ov4, -overs=4 or -onfsvers=4, fail as,

# mount -t nfs -ov4 192.168.31.12:/ /testidr/
mount.nfs: access denied by server while mounting 192.168.31.12:/
Fixes f980298853 "mount.nfs: configurable minor version defaults"
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
utils/mount/stropts.c +0 -6
index df67fac..2ae532e 100644
@@ -108,12 +108,6 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode == V_DEFAULT) {
-		mi->version.v_mode = V_SPECIFIC;
-		return;
-	}
-
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
@@ -121,9 +115,9 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
Quoted 14 lines
Quoted 10 lines
utils/mount/stropts.c +3 -4
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode != V_DEFAULT) {
-		if (mi->version.major == config_default_vers.major)
+	if (mi->version.v_mode == V_GENERAL) {
+		if (config_default_vers.v_mode != V_DEFAULT &&
+		    mi->version.major == config_default_vers.major)
 			mi->version.minor = config_default_vers.minor;
 		return;
 	}
--
Quoted 3 lines

2.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#5 lore raw
Quoted 16 lines · Kinglong Mee
Quoted 15 lines · Benjamin Coddington
Quoted 12 lines · Kinglong Mee
Quoted 3 lines · Benjamin Coddington

Hi Kinglong, I can't seem to figure out how to reproduce your problem, and I don't see show this change fixes it. Your mount is falling back to a v3 attempt without this patch? What's set in nfsmount.conf?

Sorry for my missing notes for nfsmount.conf.
My nfsmount.conf is default config,
besides [ NFSMount_Global_Options ], others line are commented by "#", Defaultvers isn't set as, "# Defaultvers=4"

thanks,
Kinglong Mee

Quoted 8 lines
Quoted 4 lines

Yes, I see the problem now. The version strings were stripped and never
added back in the general case. Thank you. This looks right.

Hello Steve,

What's the status of this patch?

I'm working on it... ;-)

steved.

Quoted 59 lines

thanks,
Kinglong Mee

Quoted 55 lines
Quoted 54 lines
Quoted 35 lines · Kinglong Mee
Quoted 33 lines

When mounting nfs with -ov4, -overs=4 or -onfsvers=4, fail as,

# mount -t nfs -ov4 192.168.31.12:/ /testidr/
mount.nfs: access denied by server while mounting 192.168.31.12:/
Fixes f980298853 "mount.nfs: configurable minor version defaults"
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
utils/mount/stropts.c +0 -6
index df67fac..2ae532e 100644
@@ -108,12 +108,6 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode == V_DEFAULT) {
-		mi->version.v_mode = V_SPECIFIC;
-		return;
-	}
-
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
@@ -121,9 +115,9 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
Quoted 14 lines
Quoted 10 lines
utils/mount/stropts.c +3 -4
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode != V_DEFAULT) {
-		if (mi->version.major == config_default_vers.major)
+	if (mi->version.v_mode == V_GENERAL) {
+		if (config_default_vers.v_mode != V_DEFAULT &&
+		    mi->version.major == config_default_vers.major)
 			mi->version.minor = config_default_vers.minor;
 		return;
 	}
--
Quoted 3 lines

2.3.5

--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in the body of a message to [email protected]
More majordomo info at http://vger.kernel.org/majordomo-info.html

#6 lore raw
In reply to Kinglong Mee
Quoted 7 lines · Kinglong Mee

When mounting nfs with -ov4, -overs=4 or -onfsvers=4, fail as,

# mount -t nfs -ov4 192.168.31.12:/ /testidr/
mount.nfs: access denied by server while mounting 192.168.31.12:/
Fixes f980298853 "mount.nfs: configurable minor version defaults"

Committed...

steved

Quoted 35 lines
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)
utils/mount/stropts.c +3 -9
index df67fac..2ae532e 100644
@@ -108,12 +108,6 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode == V_DEFAULT) {
-		mi->version.v_mode = V_SPECIFIC;
-		return;
-	}
-
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
@@ -121,9 +115,9 @@ static void nfs_default_version(struct nfsmount_info *mi)
 		return;
 	}
 
-	if (mi->version.v_mode == V_GENERAL &&
-		config_default_vers.v_mode != V_DEFAULT) {
-		if (mi->version.major == config_default_vers.major)
+	if (mi->version.v_mode == V_GENERAL) {
+		if (config_default_vers.v_mode != V_DEFAULT &&
+		    mi->version.major == config_default_vers.major)
 			mi->version.minor = config_default_vers.minor;
 		return;
 	}