All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/3] support "-t nfs -o vers=4" [take 3]
@ 2009-09-08 21:02 Chuck Lever
       [not found] ` <20090908210012.3326.57767.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  0 siblings, 1 reply; 7+ messages in thread
From: Chuck Lever @ 2009-09-08 21:02 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

Hi Steve-

These changes accompany kernel support for "-t nfs -o vers=4".

One patch description was clarified, and a bug was fixed in the last
patch of this series.

---

Chuck Lever (3):
      mount.nfs: Detect "-t nfs -o vers=4" mounts
      umount.nfs: Skip UMNT call for "-t nfs -o vers=4" mounts
      mount.nfs: Support "vers=4" in nfs_nfs_version()


 utils/mount/network.c   |   14 +++++++++-----
 utils/mount/network.h   |    1 +
 utils/mount/nfsumount.c |    4 ++++
 utils/mount/stropts.c   |   10 ++++++++--
 4 files changed, 22 insertions(+), 7 deletions(-)

-- 
Chuck Lever <chuck.lever@oracle.com>

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

* [PATCH 1/3] mount.nfs: Support "vers=4" in nfs_nfs_version()
       [not found] ` <20090908210012.3326.57767.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
@ 2009-09-08 21:02   ` Chuck Lever
  2009-09-08 21:02   ` [PATCH 2/3] umount.nfs: Skip UMNT call for "-t nfs -o vers=4" mounts Chuck Lever
                     ` (3 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2009-09-08 21:02 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

To handle "-t nfs -o vers=4" the nfs_nfs_version() function must
recognize "vers=4," "v4," and "nfsvers=4".

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mount/network.c |   12 ++++++++----
 1 files changed, 8 insertions(+), 4 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index f6fa5fd..420e15a 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -90,6 +90,7 @@ static const char *nfs_transport_opttbl[] = {
 static const char *nfs_version_opttbl[] = {
 	"v2",
 	"v3",
+	"v4",
 	"vers",
 	"nfsvers",
 	NULL,
@@ -1215,10 +1216,13 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
 	case 1: /* v3 */
 		*version = 3;
 		return 1;
-	case 2:	/* vers */
+	case 2: /* v4 */
+		*version = 4;
+		return 1;
+	case 3:	/* vers */
 		switch (po_get_numeric(options, "vers", &tmp)) {
 		case PO_FOUND:
-			if (tmp >= 2 && tmp <= 3) {
+			if (tmp >= 2 && tmp <= 4) {
 				*version = tmp;
 				return 1;
 			}
@@ -1229,10 +1233,10 @@ nfs_nfs_version(struct mount_options *options, unsigned long *version)
 		case PO_BAD_VALUE:
 			return 0;
 		}
-	case 3: /* nfsvers */
+	case 4: /* nfsvers */
 		switch (po_get_numeric(options, "nfsvers", &tmp)) {
 		case PO_FOUND:
-			if (tmp >= 2 && tmp <= 3) {
+			if (tmp >= 2 && tmp <= 4) {
 				*version = tmp;
 				return 1;
 			}


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

* [PATCH 2/3] umount.nfs: Skip UMNT call for "-t nfs -o vers=4" mounts
       [not found] ` <20090908210012.3326.57767.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  2009-09-08 21:02   ` [PATCH 1/3] mount.nfs: Support "vers=4" in nfs_nfs_version() Chuck Lever
@ 2009-09-08 21:02   ` Chuck Lever
  2009-09-08 21:03   ` [PATCH 3/3] mount.nfs: Detect " Chuck Lever
                     ` (2 subsequent siblings)
  4 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2009-09-08 21:02 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mount/nfsumount.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/utils/mount/nfsumount.c b/utils/mount/nfsumount.c
index f81db14..c5505b1 100644
--- a/utils/mount/nfsumount.c
+++ b/utils/mount/nfsumount.c
@@ -179,6 +179,10 @@ static int nfs_umount_do_umnt(struct mount_options *options,
 		return EX_FAIL;
 	}
 
+	/* Skip UMNT call for vers=4 mounts */
+	if (nfs_pmap.pm_vers == 4)
+		return EX_SUCCESS;
+
 	*hostname = nfs_umount_hostname(options, *hostname);
 	if (!*hostname) {
 		nfs_error(_("%s: out of memory"), progname);


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

* [PATCH 3/3] mount.nfs: Detect "-t nfs -o vers=4" mounts
       [not found] ` <20090908210012.3326.57767.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  2009-09-08 21:02   ` [PATCH 1/3] mount.nfs: Support "vers=4" in nfs_nfs_version() Chuck Lever
  2009-09-08 21:02   ` [PATCH 2/3] umount.nfs: Skip UMNT call for "-t nfs -o vers=4" mounts Chuck Lever
@ 2009-09-08 21:03   ` Chuck Lever
  2009-09-08 21:11   ` [PATCH 0/3] support "-t nfs -o vers=4" [take 3] Steve Dickson
  2009-09-14 18:13   ` Steve Dickson
  4 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2009-09-08 21:03 UTC (permalink / raw)
  To: steved; +Cc: linux-nfs

For "-t nfs -o vers=4" mounts, we want to skip v2/v3 version/transport
negotiation, but be sure to append the "clientaddr" option.

Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
---

 utils/mount/network.c |    2 +-
 utils/mount/network.h |    1 +
 utils/mount/stropts.c |   10 ++++++++--
 3 files changed, 10 insertions(+), 3 deletions(-)

diff --git a/utils/mount/network.c b/utils/mount/network.c
index 420e15a..bd621be 100644
--- a/utils/mount/network.c
+++ b/utils/mount/network.c
@@ -1204,7 +1204,7 @@ nfs_nfs_program(struct mount_options *options, unsigned long *program)
  * Returns TRUE if @version contains a valid value for this option,
  * or FALSE if the option was specified with an invalid value.
  */
-static int
+int
 nfs_nfs_version(struct mount_options *options, unsigned long *version)
 {
 	long tmp;
diff --git a/utils/mount/network.h b/utils/mount/network.h
index db5134c..402e0a5 100644
--- a/utils/mount/network.h
+++ b/utils/mount/network.h
@@ -56,6 +56,7 @@ int clnt_ping(struct sockaddr_in *, const unsigned long,
 
 struct mount_options;
 
+int nfs_nfs_version(struct mount_options *options, unsigned long *version);
 int nfs_options2pmap(struct mount_options *,
 		      struct pmap *, struct pmap *);
 
diff --git a/utils/mount/stropts.c b/utils/mount/stropts.c
index a12ace7..3eb661e 100644
--- a/utils/mount/stropts.c
+++ b/utils/mount/stropts.c
@@ -84,6 +84,7 @@ struct nfsmount_info {
 	struct mount_options	*options;	/* parsed mount options */
 	char			**extra_opts;	/* string for /etc/mtab */
 
+	unsigned long		version;	/* NFS version */
 	int			flags,		/* MS_ flags */
 				fake,		/* actually do the mount? */
 				child;		/* forked bg child? */
@@ -272,7 +273,12 @@ static int nfs_validate_options(struct nfsmount_info *mi)
 	if (!nfs_name_to_address(mi->hostname, sap, &salen))
 		return 0;
 
-	if (strncmp(mi->type, "nfs4", 4) == 0) {
+	if (!nfs_nfs_version(mi->options, &mi->version))
+		return 0;
+	if (strncmp(mi->type, "nfs4", 4) == 0)
+		mi->version = 4;
+
+	if (mi->version == 4) {
 		if (!nfs_append_clientaddr_option(sap, salen, mi->options))
 			return 0;
 	} else {
@@ -488,7 +494,7 @@ static int nfs_try_mount(struct nfsmount_info *mi)
 	char *options = NULL;
 	int result;
 
-	if (strncmp(mi->type, "nfs4", 4) != 0) {
+	if (mi->version != 4) {
 		if (!nfs_rewrite_pmap_mount_options(mi->options))
 			return 0;
 	}


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

* Re: [PATCH 0/3] support "-t nfs -o vers=4" [take 3]
       [not found] ` <20090908210012.3326.57767.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
                     ` (2 preceding siblings ...)
  2009-09-08 21:03   ` [PATCH 3/3] mount.nfs: Detect " Chuck Lever
@ 2009-09-08 21:11   ` Steve Dickson
       [not found]     ` <4AA6C89F.1030801-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
  2009-09-14 18:13   ` Steve Dickson
  4 siblings, 1 reply; 7+ messages in thread
From: Steve Dickson @ 2009-09-08 21:11 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs



On 09/08/2009 05:02 PM, Chuck Lever wrote:
> Hi Steve-
> 
> These changes accompany kernel support for "-t nfs -o vers=4".
> 
> One patch description was clarified, and a bug was fixed in the last
> patch of this series.
> 
I'm a bit concern about committing these since its not clear which 
kernel the supporting patches will be in... Why document something
that does not work... 

steved.

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

* Re: [PATCH 0/3] support "-t nfs -o vers=4" [take 3]
       [not found]     ` <4AA6C89F.1030801-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
@ 2009-09-08 21:18       ` Chuck Lever
  0 siblings, 0 replies; 7+ messages in thread
From: Chuck Lever @ 2009-09-08 21:18 UTC (permalink / raw)
  To: Steve Dickson; +Cc: linux-nfs

On Sep 8, 2009, at 5:11 PM, Steve Dickson wrote:
> On 09/08/2009 05:02 PM, Chuck Lever wrote:
>> Hi Steve-
>>
>> These changes accompany kernel support for "-t nfs -o vers=4".
>>
>> One patch description was clarified, and a bug was fixed in the last
>> patch of this series.
>>
> I'm a bit concern about committing these since its not clear which
> kernel the supporting patches will be in... Why document something
> that does not work...

If Trond doesn't accept the kernel patches, you can trash bin these.   
Otherwise there's no need to do anything until we know how "vers=4"  
will be supported.

But I wanted to be sure you had the version of this series with the  
bug fix.

--
Chuck Lever
chuck[dot]lever[at]oracle[dot]com




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

* Re: [PATCH 0/3] support "-t nfs -o vers=4" [take 3]
       [not found] ` <20090908210012.3326.57767.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
                     ` (3 preceding siblings ...)
  2009-09-08 21:11   ` [PATCH 0/3] support "-t nfs -o vers=4" [take 3] Steve Dickson
@ 2009-09-14 18:13   ` Steve Dickson
  4 siblings, 0 replies; 7+ messages in thread
From: Steve Dickson @ 2009-09-14 18:13 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs



On 09/08/2009 05:02 PM, Chuck Lever wrote:
> Hi Steve-
> 
> These changes accompany kernel support for "-t nfs -o vers=4".
> 
> One patch description was clarified, and a bug was fixed in the last
> patch of this series.
> 
> ---
> 
> Chuck Lever (3):
>       mount.nfs: Detect "-t nfs -o vers=4" mounts
>       umount.nfs: Skip UMNT call for "-t nfs -o vers=4" mounts
>       mount.nfs: Support "vers=4" in nfs_nfs_version()
> 
> 
Committed... Note I rolled these three patches into one since the
were all fairly straightforward and it will be easier to 
manage them, if need be..

steved.

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

end of thread, other threads:[~2009-09-14 18:13 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-08 21:02 [PATCH 0/3] support "-t nfs -o vers=4" [take 3] Chuck Lever
     [not found] ` <20090908210012.3326.57767.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-09-08 21:02   ` [PATCH 1/3] mount.nfs: Support "vers=4" in nfs_nfs_version() Chuck Lever
2009-09-08 21:02   ` [PATCH 2/3] umount.nfs: Skip UMNT call for "-t nfs -o vers=4" mounts Chuck Lever
2009-09-08 21:03   ` [PATCH 3/3] mount.nfs: Detect " Chuck Lever
2009-09-08 21:11   ` [PATCH 0/3] support "-t nfs -o vers=4" [take 3] Steve Dickson
     [not found]     ` <4AA6C89F.1030801-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-09-08 21:18       ` Chuck Lever
2009-09-14 18:13   ` 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.