diff mbox

[1/2,V3] mount.nfs: Use default minor version when -t nfs4 is specified

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

Commit Message

Steve Dickson June 19, 2017, 3:10 p.m. UTC
When the nfs4 filesystem specified, the default major
and minor versions should be used.

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

v2: Added the NFS_DEFAULT_MAJOR/MINOR defines
v3: Add back the setting of v_mode to V_GENERAL in nfs_set_version()
diff mbox

Patch

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index c0266e5..fbea6fb 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -73,6 +73,13 @@ 
 #define NFS_DEF_BG_TIMEOUT_MINUTES	(10000u)
 #endif
 
+#ifndef NFS_DEFAULT_MAJOR
+#define NFS_DEFAULT_MAJOR	4
+#endif
+#ifndef NFS_DEFAULT_MINOR
+#define NFS_DEFAULT_MINOR	2
+#endif
+
 extern int nfs_mount_data_version;
 extern char *progname;
 extern int verbose;
@@ -124,8 +131,8 @@  static void nfs_default_version(struct nfsmount_info *mi)
 	}
 
 #endif /* MOUNT_CONFIG */
-	mi->version.major = 4;
-	mi->version.minor = 2;
+	mi->version.major = NFS_DEFAULT_MAJOR;
+	mi->version.minor = NFS_DEFAULT_MINOR;
 }
 
 /*
@@ -316,7 +323,9 @@  static int nfs_set_version(struct nfsmount_info *mi)
 		return 0;
 
 	if (strncmp(mi->type, "nfs4", 4) == 0) {
-		mi->version.major = 4;
+		/* Set to default values */
+		mi->version.major = NFS_DEFAULT_MAJOR;
+		mi->version.minor = NFS_DEFAULT_MINOR;
 		mi->version.v_mode = V_GENERAL;
 	}
 	/*