linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] mount: make sure mounting nfs with v4,vers=4 and nfsvers=4
@ 2015-04-12 12:04 Kinglong Mee
  2015-04-13 12:16 ` Benjamin Coddington
  2015-05-07 14:13 ` Steve Dickson
  0 siblings, 2 replies; 7+ messages in thread
From: Kinglong Mee @ 2015-04-12 12:04 UTC (permalink / raw)
  To: Steve Dickson; +Cc: bcodding, linux-nfs@vger.kernel.org, kinglongmee

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" 
Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 utils/mount/stropts.c | 12 +++---------
 1 file changed, 3 insertions(+), 9 deletions(-)

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index df67fac..2ae532e 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -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

^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2015-05-07 14:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-04-12 12:04 [PATCH] mount: make sure mounting nfs with v4,vers=4 and nfsvers=4 Kinglong Mee
2015-04-13 12:16 ` Benjamin Coddington
2015-04-13 12:21   ` Kinglong Mee
2015-04-13 12:43     ` Benjamin Coddington
2015-05-06 13:36       ` Kinglong Mee
2015-05-06 18:37         ` Steve Dickson
2015-05-07 14:13 ` Steve Dickson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).