All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 is specified
@ 2017-06-19 15:25 Steve Dickson
  2017-06-19 15:25 ` [PATCH 2/2 V4] mount.nfs: Use default minor version when -o v4 " Steve Dickson
  2017-06-21 16:18 ` [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 " Steve Dickson
  0 siblings, 2 replies; 4+ messages in thread
From: Steve Dickson @ 2017-06-19 15:25 UTC (permalink / raw)
  To: Linux NFS Mailing list

When the nfs4 filesystem specified, the default major
and minor versions should be used.

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

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

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;
 	}
 	/*
-- 
2.9.4


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

* [PATCH 2/2 V4] mount.nfs: Use default minor version when -o v4 is specified
  2017-06-19 15:25 [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 is specified Steve Dickson
@ 2017-06-19 15:25 ` Steve Dickson
  2017-06-21 16:19   ` Steve Dickson
  2017-06-21 16:18 ` [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 " Steve Dickson
  1 sibling, 1 reply; 4+ messages in thread
From: Steve Dickson @ 2017-06-19 15:25 UTC (permalink / raw)
  To: Linux NFS Mailing list

When v4 is specified on the command line the
default minor version needs to be used.

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

v2: Removed pointless check of v_mode in nfs_do_mount_v4()
v3: Correctly set the minor version when set in nfsmount.conf
v4: Post the correct patch!!! 

diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index fbea6fb..c2a739b 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -119,14 +119,22 @@ static void nfs_default_version(struct nfsmount_info *mi)
 	if (mi->version.v_mode == V_DEFAULT &&
 		config_default_vers.v_mode != V_DEFAULT) {
 		mi->version.major = config_default_vers.major;
-		mi->version.minor = config_default_vers.minor;
+		if (config_default_vers.v_mode == V_SPECIFIC)
+			mi->version.minor = config_default_vers.minor;
+		else
+			mi->version.minor = NFS_DEFAULT_MINOR;
 		return;
 	}
 
 	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;
+		    mi->version.major == config_default_vers.major) {
+			if (config_default_vers.v_mode == V_SPECIFIC)
+				mi->version.minor = config_default_vers.minor;
+			else
+				mi->version.minor = NFS_DEFAULT_MINOR;
+		} else
+			mi->version.minor = NFS_DEFAULT_MINOR;
 		return;
 	}
 
@@ -741,13 +749,9 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
 	}
 
 	if (mi->version.v_mode != V_SPECIFIC) {
-		if (mi->version.v_mode == V_GENERAL)
-			snprintf(version_opt, sizeof(version_opt) - 1,
-				"vers=%lu", mi->version.major);
-		else
-			snprintf(version_opt, sizeof(version_opt) - 1,
-				"vers=%lu.%lu", mi->version.major,
-				mi->version.minor);
+		snprintf(version_opt, sizeof(version_opt) - 1,
+			"vers=%lu.%lu", mi->version.major,
+			mi->version.minor);
 
 		if (po_append(options, version_opt) == PO_FAILED) {
 			errno = EINVAL;
-- 
2.9.4


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

* Re: [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 is specified
  2017-06-19 15:25 [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 is specified Steve Dickson
  2017-06-19 15:25 ` [PATCH 2/2 V4] mount.nfs: Use default minor version when -o v4 " Steve Dickson
@ 2017-06-21 16:18 ` Steve Dickson
  1 sibling, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2017-06-21 16:18 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 06/19/2017 11:25 AM, Steve Dickson wrote:
> When the nfs4 filesystem specified, the default major
> and minor versions should be used.
> 
> v2: Added the NFS_DEFAULT_MAJOR/MINOR defines
> v3: Add back the setting of v_mode to V_GENERAL in nfs_set_version()
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
Committed... 

steved.

> ---
>  utils/mount/stropts.c | 15 ++++++++++++---
>  1 file changed, 12 insertions(+), 3 deletions(-)
> 
> 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;
>  	}
>  	/*
> 

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

* Re: [PATCH 2/2 V4] mount.nfs: Use default minor version when -o v4 is specified
  2017-06-19 15:25 ` [PATCH 2/2 V4] mount.nfs: Use default minor version when -o v4 " Steve Dickson
@ 2017-06-21 16:19   ` Steve Dickson
  0 siblings, 0 replies; 4+ messages in thread
From: Steve Dickson @ 2017-06-21 16:19 UTC (permalink / raw)
  To: Linux NFS Mailing list



On 06/19/2017 11:25 AM, Steve Dickson wrote:
> When v4 is specified on the command line the
> default minor version needs to be used.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  utils/mount/stropts.c | 24 ++++++++++++++----------
>  1 file changed, 14 insertions(+), 10 deletions(-)
> 
> v2: Removed pointless check of v_mode in nfs_do_mount_v4()
> v3: Correctly set the minor version when set in nfsmount.conf
> v4: Post the correct patch!!! 
Committed...

steved. 
> 
> diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
> index fbea6fb..c2a739b 100644
> --- a/utils/mount/stropts.c
> +++ b/utils/mount/stropts.c
> @@ -119,14 +119,22 @@ static void nfs_default_version(struct nfsmount_info *mi)
>  	if (mi->version.v_mode == V_DEFAULT &&
>  		config_default_vers.v_mode != V_DEFAULT) {
>  		mi->version.major = config_default_vers.major;
> -		mi->version.minor = config_default_vers.minor;
> +		if (config_default_vers.v_mode == V_SPECIFIC)
> +			mi->version.minor = config_default_vers.minor;
> +		else
> +			mi->version.minor = NFS_DEFAULT_MINOR;
>  		return;
>  	}
>  
>  	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;
> +		    mi->version.major == config_default_vers.major) {
> +			if (config_default_vers.v_mode == V_SPECIFIC)
> +				mi->version.minor = config_default_vers.minor;
> +			else
> +				mi->version.minor = NFS_DEFAULT_MINOR;
> +		} else
> +			mi->version.minor = NFS_DEFAULT_MINOR;
>  		return;
>  	}
>  
> @@ -741,13 +749,9 @@ static int nfs_do_mount_v4(struct nfsmount_info *mi,
>  	}
>  
>  	if (mi->version.v_mode != V_SPECIFIC) {
> -		if (mi->version.v_mode == V_GENERAL)
> -			snprintf(version_opt, sizeof(version_opt) - 1,
> -				"vers=%lu", mi->version.major);
> -		else
> -			snprintf(version_opt, sizeof(version_opt) - 1,
> -				"vers=%lu.%lu", mi->version.major,
> -				mi->version.minor);
> +		snprintf(version_opt, sizeof(version_opt) - 1,
> +			"vers=%lu.%lu", mi->version.major,
> +			mi->version.minor);
>  
>  		if (po_append(options, version_opt) == PO_FAILED) {
>  			errno = EINVAL;
> 

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

end of thread, other threads:[~2017-06-21 16:28 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2017-06-19 15:25 [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 is specified Steve Dickson
2017-06-19 15:25 ` [PATCH 2/2 V4] mount.nfs: Use default minor version when -o v4 " Steve Dickson
2017-06-21 16:19   ` Steve Dickson
2017-06-21 16:18 ` [PATCH 1/2 V3] mount.nfs: Use default minor version when -t nfs4 " Steve Dickson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.