linux-nfs.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4]
@ 2009-09-02 13:51 Chuck Lever
       [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Chuck Lever @ 2009-09-02 13:51 UTC (permalink / raw)
  To: trond.myklebust; +Cc: linux-nfs

Sorry for the repost.  After reading the patch descriptions again, I
thought they needed some clarification.

---

Chuck Lever (4):
      NFS: Allow the "nfs" file system type to support NFSv4
      NFS: Move details of nfs4_get_sb() to a helper
      NFS: Refactor NFSv4 text-based mount option validation
      NFS: Mount option parser should detect missing "port="


 fs/nfs/internal.h    |   10 ++
 fs/nfs/super.c       |  202 +++++++++++++++++++++++++++++++++-----------------
 include/linux/nfs4.h |    1 
 3 files changed, 144 insertions(+), 69 deletions(-)

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

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

* [PATCH 1/4] NFS: Mount option parser should detect missing "port="
       [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
@ 2009-09-02 13:52   ` Chuck Lever
  2009-09-02 13:52   ` [PATCH 2/4] NFS: Refactor NFSv4 text-based mount option validation Chuck Lever
                     ` (4 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Chuck Lever @ 2009-09-02 13:52 UTC (permalink / raw)
  To: trond.myklebust; +Cc: linux-nfs

The meaning of not specifying the "port=" mount option is different
for "-t nfs" and "-t nfs4" mounts.  The default port value for
NFSv2/v3 mounts is 0, but the default for NFSv4 mounts is 2049.

To support "-t nfs -o vers=4", the mount option parser must detect
when "port=" is missing so that the correct default port value can be
set depending on which NFS version is requested.

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

 fs/nfs/internal.h |    9 +++++++--
 fs/nfs/super.c    |   55 ++++++++++++++++++++++++++++-------------------------
 2 files changed, 36 insertions(+), 28 deletions(-)

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index dabf345..ffadffa 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -49,6 +49,11 @@ struct nfs_clone_mount {
 #define NFS_MAX_SECFLAVORS	(12)
 
 /*
+ * Value used if the user did not specify a port value.
+ */
+#define NFS_UNSPEC_PORT		(-1)
+
+/*
  * In-kernel mount arguments
  */
 struct nfs_parsed_mount_data {
@@ -71,7 +76,7 @@ struct nfs_parsed_mount_data {
 		size_t			addrlen;
 		char			*hostname;
 		u32			version;
-		unsigned short		port;
+		int			port;
 		unsigned short		protocol;
 	} mount_server;
 
@@ -80,7 +85,7 @@ struct nfs_parsed_mount_data {
 		size_t			addrlen;
 		char			*hostname;
 		char			*export_path;
-		unsigned short		port;
+		int			port;
 		unsigned short		protocol;
 	} nfs_server;
 
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index f3a95df..0554433 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -747,6 +747,21 @@ static int nfs_verify_server_address(struct sockaddr *addr)
 }
 
 /*
+ * Select between a default port value and a user-specified port value.
+ * If a zero value is set, then autobind will be used.
+ */
+static void nfs_set_default_port(struct sockaddr *sap, const int parsed_port,
+				 const unsigned short default_port)
+{
+	unsigned short port = default_port;
+
+	if (parsed_port != NFS_UNSPEC_PORT)
+		port = parsed_port;
+
+	rpc_set_port(sap, port);
+}
+
+/*
  * Sanity check the NFS transport protocol.
  *
  */
@@ -1415,11 +1430,7 @@ static int nfs_try_mount(struct nfs_parsed_mount_data *args,
 		args->mount_server.addrlen = args->nfs_server.addrlen;
 	}
 	request.salen = args->mount_server.addrlen;
-
-	/*
-	 * autobind will be used if mount_server.port == 0
-	 */
-	rpc_set_port(request.sap, args->mount_server.port);
+	nfs_set_default_port(request.sap, args->mount_server.port, 0);
 
 	/*
 	 * Now ask the mount server to map our export path
@@ -1597,6 +1608,7 @@ static int nfs_validate_mount_data(void *options,
 				   const char *dev_name)
 {
 	struct nfs_mount_data *data = (struct nfs_mount_data *)options;
+	struct sockaddr *sap = (struct sockaddr *)&args->nfs_server.address;
 
 	if (data == NULL)
 		goto out_no_data;
@@ -1608,8 +1620,8 @@ static int nfs_validate_mount_data(void *options,
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;
 	args->acdirmax		= NFS_DEF_ACDIRMAX;
-	args->mount_server.port	= 0;	/* autobind unless user sets port */
-	args->nfs_server.port	= 0;	/* autobind unless user sets port */
+	args->mount_server.port	= NFS_UNSPEC_PORT;
+	args->nfs_server.port	= NFS_UNSPEC_PORT;
 	args->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 	args->auth_flavors[0]	= RPC_AUTH_UNIX;
 	args->auth_flavor_len	= 1;
@@ -1657,11 +1669,9 @@ static int nfs_validate_mount_data(void *options,
 		args->acdirmin		= data->acdirmin;
 		args->acdirmax		= data->acdirmax;
 
-		memcpy(&args->nfs_server.address, &data->addr,
-		       sizeof(data->addr));
+		memcpy(sap, &data->addr, sizeof(data->addr));
 		args->nfs_server.addrlen = sizeof(data->addr);
-		if (!nfs_verify_server_address((struct sockaddr *)
-						&args->nfs_server.address))
+		if (!nfs_verify_server_address(sap))
 			goto out_no_address;
 
 		if (!(data->flags & NFS_MOUNT_TCP))
@@ -1709,12 +1719,10 @@ static int nfs_validate_mount_data(void *options,
 		if (nfs_parse_mount_options((char *)options, args) == 0)
 			return -EINVAL;
 
-		if (!nfs_verify_server_address((struct sockaddr *)
-						&args->nfs_server.address))
+		if (!nfs_verify_server_address(sap))
 			goto out_no_address;
 
-		rpc_set_port((struct sockaddr *)&args->nfs_server.address,
-				args->nfs_server.port);
+		nfs_set_default_port(sap, args->nfs_server.port, 0);
 
 		nfs_set_mount_transport_protocol(args);
 
@@ -2261,7 +2269,7 @@ static int nfs4_validate_mount_data(void *options,
 				    struct nfs_parsed_mount_data *args,
 				    const char *dev_name)
 {
-	struct sockaddr_in *ap;
+	struct sockaddr *sap = (struct sockaddr *)&args->nfs_server.address;
 	struct nfs4_mount_data *data = (struct nfs4_mount_data *)options;
 	char *c;
 
@@ -2274,23 +2282,21 @@ static int nfs4_validate_mount_data(void *options,
 	args->acregmax		= NFS_DEF_ACREGMAX;
 	args->acdirmin		= NFS_DEF_ACDIRMIN;
 	args->acdirmax		= NFS_DEF_ACDIRMAX;
-	args->nfs_server.port	= NFS_PORT; /* 2049 unless user set port= */
+	args->nfs_server.port	= NFS_UNSPEC_PORT;
 	args->auth_flavors[0]	= RPC_AUTH_UNIX;
 	args->auth_flavor_len	= 1;
 	args->minorversion	= 0;
 
 	switch (data->version) {
 	case 1:
-		ap = (struct sockaddr_in *)&args->nfs_server.address;
 		if (data->host_addrlen > sizeof(args->nfs_server.address))
 			goto out_no_address;
 		if (data->host_addrlen == 0)
 			goto out_no_address;
 		args->nfs_server.addrlen = data->host_addrlen;
-		if (copy_from_user(ap, data->host_addr, data->host_addrlen))
+		if (copy_from_user(sap, data->host_addr, data->host_addrlen))
 			return -EFAULT;
-		if (!nfs_verify_server_address((struct sockaddr *)
-						&args->nfs_server.address))
+		if (!nfs_verify_server_address(sap))
 			goto out_no_address;
 
 		if (data->auth_flavourlen) {
@@ -2342,12 +2348,9 @@ static int nfs4_validate_mount_data(void *options,
 		if (nfs_parse_mount_options((char *)options, args) == 0)
 			return -EINVAL;
 
-		if (!nfs_verify_server_address((struct sockaddr *)
-						&args->nfs_server.address))
+		if (!nfs_verify_server_address(sap))
 			return -EINVAL;
-
-		rpc_set_port((struct sockaddr *)&args->nfs_server.address,
-				args->nfs_server.port);
+		nfs_set_default_port(sap, args->nfs_server.port, NFS_PORT);
 
 		nfs_validate_transport_protocol(args);
 


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

* [PATCH 2/4] NFS: Refactor NFSv4 text-based mount option validation
       [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  2009-09-02 13:52   ` [PATCH 1/4] NFS: Mount option parser should detect missing "port=" Chuck Lever
@ 2009-09-02 13:52   ` Chuck Lever
  2009-09-02 13:52   ` [PATCH 3/4] NFS: Move details of nfs4_get_sb() to a helper Chuck Lever
                     ` (3 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Chuck Lever @ 2009-09-02 13:52 UTC (permalink / raw)
  To: trond.myklebust; +Cc: linux-nfs

Clean up: Refactor the part of nfs4_validate_mount_options() that
handles text-based options, so we can call it from the NFSv2/v3
option validation function.

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

 fs/nfs/super.c |   63 +++++++++++++++++++++++++++++++-------------------------
 1 files changed, 35 insertions(+), 28 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 0554433..599e8c5 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -272,6 +272,8 @@ static const struct super_operations nfs_sops = {
 };
 
 #ifdef CONFIG_NFS_V4
+static int nfs4_validate_text_mount_data(void *options,
+	struct nfs_parsed_mount_data *args, const char *dev_name);
 static int nfs4_get_sb(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
 static int nfs4_remote_get_sb(struct file_system_type *fs_type,
@@ -2262,6 +2264,37 @@ static void nfs4_validate_mount_flags(struct nfs_parsed_mount_data *args)
 	args->flags &= ~(NFS_MOUNT_NONLM|NFS_MOUNT_NOACL|NFS_MOUNT_VER3);
 }
 
+static int nfs4_validate_text_mount_data(void *options,
+					 struct nfs_parsed_mount_data *args,
+					 const char *dev_name)
+{
+	struct sockaddr *sap = (struct sockaddr *)&args->nfs_server.address;
+
+	nfs_set_default_port(sap, args->nfs_server.port, NFS_PORT);
+
+	nfs_validate_transport_protocol(args);
+
+	nfs4_validate_mount_flags(args);
+
+	if (args->auth_flavor_len > 1) {
+		dfprintk(MOUNT,
+			 "NFS4: Too many RPC auth flavours specified\n");
+		return -EINVAL;
+	}
+
+	if (args->client_address == NULL) {
+		dfprintk(MOUNT,
+			 "NFS4: mount program didn't pass callback address\n");
+		return -EINVAL;
+	}
+
+	return nfs_parse_devname(dev_name,
+				   &args->nfs_server.hostname,
+				   NFS4_MAXNAMLEN,
+				   &args->nfs_server.export_path,
+				   NFS4_MAXPATHLEN);
+}
+
 /*
  * Validate NFSv4 mount options
  */
@@ -2342,36 +2375,14 @@ static int nfs4_validate_mount_data(void *options,
 		nfs_validate_transport_protocol(args);
 
 		break;
-	default: {
-		int status;
-
+	default:
 		if (nfs_parse_mount_options((char *)options, args) == 0)
 			return -EINVAL;
 
 		if (!nfs_verify_server_address(sap))
 			return -EINVAL;
-		nfs_set_default_port(sap, args->nfs_server.port, NFS_PORT);
-
-		nfs_validate_transport_protocol(args);
-
-		nfs4_validate_mount_flags(args);
-
-		if (args->auth_flavor_len > 1)
-			goto out_inval_auth;
-
-		if (args->client_address == NULL)
-			goto out_no_client_address;
-
-		status = nfs_parse_devname(dev_name,
-					   &args->nfs_server.hostname,
-					   NFS4_MAXNAMLEN,
-					   &args->nfs_server.export_path,
-					   NFS4_MAXPATHLEN);
-		if (status < 0)
-			return status;
 
-		break;
-		}
+		return nfs4_validate_text_mount_data(options, args, dev_name);
 	}
 
 	return 0;
@@ -2388,10 +2399,6 @@ out_inval_auth:
 out_no_address:
 	dfprintk(MOUNT, "NFS4: mount program didn't pass remote address\n");
 	return -EINVAL;
-
-out_no_client_address:
-	dfprintk(MOUNT, "NFS4: mount program didn't pass callback address\n");
-	return -EINVAL;
 }
 
 /*


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

* [PATCH 3/4] NFS: Move details of nfs4_get_sb() to a helper
       [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  2009-09-02 13:52   ` [PATCH 1/4] NFS: Mount option parser should detect missing "port=" Chuck Lever
  2009-09-02 13:52   ` [PATCH 2/4] NFS: Refactor NFSv4 text-based mount option validation Chuck Lever
@ 2009-09-02 13:52   ` Chuck Lever
  2009-09-02 13:52   ` [PATCH 4/4] NFS: Allow the "nfs" file system type to support NFSv4 Chuck Lever
                     ` (2 subsequent siblings)
  5 siblings, 0 replies; 12+ messages in thread
From: Chuck Lever @ 2009-09-02 13:52 UTC (permalink / raw)
  To: trond.myklebust; +Cc: linux-nfs

Clean up: Refactor nfs4_get_sb() to allow its guts to be invoked by
nfs_get_sb().

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

 fs/nfs/super.c |   44 +++++++++++++++++++++++++++++++-------------
 1 files changed, 31 insertions(+), 13 deletions(-)

diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index 599e8c5..c105e12 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -274,6 +274,8 @@ static const struct super_operations nfs_sops = {
 #ifdef CONFIG_NFS_V4
 static int nfs4_validate_text_mount_data(void *options,
 	struct nfs_parsed_mount_data *args, const char *dev_name);
+static int nfs4_try_mount(int flags, const char *dev_name,
+	struct nfs_parsed_mount_data *data, struct vfsmount *mnt);
 static int nfs4_get_sb(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt);
 static int nfs4_remote_get_sb(struct file_system_type *fs_type,
@@ -2565,6 +2567,34 @@ out_err:
 	return ret;
 }
 
+static int nfs4_try_mount(int flags, const char *dev_name,
+			 struct nfs_parsed_mount_data *data,
+			 struct vfsmount *mnt)
+{
+	char *export_path;
+	struct vfsmount *root_mnt;
+	int error;
+
+	dfprintk(MOUNT, "--> nfs4_try_mount()\n");
+
+	export_path = data->nfs_server.export_path;
+	data->nfs_server.export_path = "/";
+	root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, data,
+			data->nfs_server.hostname);
+	data->nfs_server.export_path = export_path;
+
+	error = PTR_ERR(root_mnt);
+	if (IS_ERR(root_mnt))
+		goto out;
+
+	error = nfs_follow_remote_path(root_mnt, export_path, mnt);
+
+out:
+	dfprintk(MOUNT, "<-- nfs4_try_mount() = %d%s\n", error,
+			error != 0 ? " [error]" : "");
+	return error;
+}
+
 /*
  * Get the superblock for an NFS4 mountpoint
  */
@@ -2572,8 +2602,6 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
 	int flags, const char *dev_name, void *raw_data, struct vfsmount *mnt)
 {
 	struct nfs_parsed_mount_data *data;
-	char *export_path;
-	struct vfsmount *root_mnt;
 	int error = -ENOMEM;
 
 	data = kzalloc(sizeof(*data), GFP_KERNEL);
@@ -2585,17 +2613,7 @@ static int nfs4_get_sb(struct file_system_type *fs_type,
 	if (error < 0)
 		goto out;
 
-	export_path = data->nfs_server.export_path;
-	data->nfs_server.export_path = "/";
-	root_mnt = nfs_do_root_mount(&nfs4_remote_fs_type, flags, data,
-			data->nfs_server.hostname);
-	data->nfs_server.export_path = export_path;
-
-	error = PTR_ERR(root_mnt);
-	if (IS_ERR(root_mnt))
-		goto out;
-
-	error = nfs_follow_remote_path(root_mnt, export_path, mnt);
+	error = nfs4_try_mount(flags, dev_name, data, mnt);
 
 out:
 	kfree(data->client_address);


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

* [PATCH 4/4] NFS: Allow the "nfs" file system type to support NFSv4
       [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
                     ` (2 preceding siblings ...)
  2009-09-02 13:52   ` [PATCH 3/4] NFS: Move details of nfs4_get_sb() to a helper Chuck Lever
@ 2009-09-02 13:52   ` Chuck Lever
       [not found]     ` <20090902135222.3550.59986.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
  2009-09-02 15:10   ` [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4] Steve Dickson
  2009-09-08 18:51   ` Steve Dickson
  5 siblings, 1 reply; 12+ messages in thread
From: Chuck Lever @ 2009-09-02 13:52 UTC (permalink / raw)
  To: trond.myklebust; +Cc: linux-nfs

When mounting an "nfs" type file system, recognize "v4," "vers=4," or
"nfsvers=4" mount options, and convert the file system to "nfs4" under
the covers.

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

 fs/nfs/internal.h    |    1 +
 fs/nfs/super.c       |   42 +++++++++++++++++++++++++++++++++++++++++-
 include/linux/nfs4.h |    1 +
 3 files changed, 43 insertions(+), 1 deletions(-)

diff --git a/fs/nfs/internal.h b/fs/nfs/internal.h
index ffadffa..769582e 100644
--- a/fs/nfs/internal.h
+++ b/fs/nfs/internal.h
@@ -68,6 +68,7 @@ struct nfs_parsed_mount_data {
 	unsigned int		auth_flavor_len;
 	rpc_authflavor_t	auth_flavors[1];
 	char			*client_address;
+	unsigned int		version;
 	unsigned int		minorversion;
 	char			*fscache_uniq;
 
diff --git a/fs/nfs/super.c b/fs/nfs/super.c
index c105e12..bde444b 100644
--- a/fs/nfs/super.c
+++ b/fs/nfs/super.c
@@ -73,7 +73,7 @@ enum {
 	Opt_cto, Opt_nocto,
 	Opt_ac, Opt_noac,
 	Opt_lock, Opt_nolock,
-	Opt_v2, Opt_v3,
+	Opt_v2, Opt_v3, Opt_v4,
 	Opt_udp, Opt_tcp, Opt_rdma,
 	Opt_acl, Opt_noacl,
 	Opt_rdirplus, Opt_nordirplus,
@@ -127,6 +127,7 @@ static const match_table_t nfs_mount_option_tokens = {
 	{ Opt_nolock, "nolock" },
 	{ Opt_v2, "v2" },
 	{ Opt_v3, "v3" },
+	{ Opt_v4, "v4" },
 	{ Opt_udp, "udp" },
 	{ Opt_tcp, "tcp" },
 	{ Opt_rdma, "rdma" },
@@ -934,10 +935,18 @@ static int nfs_parse_mount_options(char *raw,
 			break;
 		case Opt_v2:
 			mnt->flags &= ~NFS_MOUNT_VER3;
+			mnt->version = 2;
 			break;
 		case Opt_v3:
 			mnt->flags |= NFS_MOUNT_VER3;
+			mnt->version = 3;
 			break;
+#ifdef CONFIG_NFS_V4
+		case Opt_v4:
+			mnt->flags &= ~NFS_MOUNT_VER3;
+			mnt->version = 4;
+			break;
+#endif
 		case Opt_udp:
 			mnt->flags &= ~NFS_MOUNT_TCP;
 			mnt->nfs_server.protocol = XPRT_TRANSPORT_UDP;
@@ -1151,10 +1160,18 @@ static int nfs_parse_mount_options(char *raw,
 			switch (option) {
 			case NFS2_VERSION:
 				mnt->flags &= ~NFS_MOUNT_VER3;
+				mnt->version = 2;
 				break;
 			case NFS3_VERSION:
 				mnt->flags |= NFS_MOUNT_VER3;
+				mnt->version = 3;
+				break;
+#ifdef CONFIG_NFS_V4
+			case NFS4_VERSION:
+				mnt->flags &= ~NFS_MOUNT_VER3;
+				mnt->version = 4;
 				break;
+#endif
 			default:
 				goto out_invalid_value;
 			}
@@ -1629,6 +1646,7 @@ static int nfs_validate_mount_data(void *options,
 	args->nfs_server.protocol = XPRT_TRANSPORT_TCP;
 	args->auth_flavors[0]	= RPC_AUTH_UNIX;
 	args->auth_flavor_len	= 1;
+	args->minorversion	= 0;
 
 	switch (data->version) {
 	case 1:
@@ -1726,6 +1744,14 @@ static int nfs_validate_mount_data(void *options,
 		if (!nfs_verify_server_address(sap))
 			goto out_no_address;
 
+		if (args->version == 4)
+#ifdef CONFIG_NFS_V4
+			return nfs4_validate_text_mount_data(options,
+							     args, dev_name);
+#else
+			goto out_v4_not_compiled;
+#endif
+
 		nfs_set_default_port(sap, args->nfs_server.port, 0);
 
 		nfs_set_mount_transport_protocol(args);
@@ -1774,6 +1800,12 @@ out_v3_not_compiled:
 	return -EPROTONOSUPPORT;
 #endif /* !CONFIG_NFS_V3 */
 
+#ifndef CONFIG_NFS_V4
+out_v4_not_compiled:
+	dfprintk(MOUNT, "NFS: NFSv4 is not compiled into kernel\n");
+	return -EPROTONOSUPPORT;
+#endif /* !CONFIG_NFS_V4 */
+
 out_nomem:
 	dfprintk(MOUNT, "NFS: not enough memory to handle mount options\n");
 	return -ENOMEM;
@@ -2069,6 +2101,14 @@ static int nfs_get_sb(struct file_system_type *fs_type,
 	if (error < 0)
 		goto out;
 
+#ifdef CONFIG_NFS_V4
+	if (data->version == 4) {
+		error = nfs4_try_mount(flags, dev_name, data, mnt);
+		kfree(data->client_address);
+		goto out;
+	}
+#endif	/* CONFIG_NFS_V4 */
+
 	/* Get a volume representation */
 	server = nfs_create_server(data, mntfh);
 	if (IS_ERR(server)) {
diff --git a/include/linux/nfs4.h b/include/linux/nfs4.h
index bd2eba5..33b2836 100644
--- a/include/linux/nfs4.h
+++ b/include/linux/nfs4.h
@@ -472,6 +472,7 @@ enum lock_type4 {
 
 #define NFSPROC4_NULL 0
 #define NFSPROC4_COMPOUND 1
+#define NFS4_VERSION 4
 #define NFS4_MINOR_VERSION 0
 
 #if defined(CONFIG_NFS_V4_1)


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

* Re: [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4]
       [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
                     ` (3 preceding siblings ...)
  2009-09-02 13:52   ` [PATCH 4/4] NFS: Allow the "nfs" file system type to support NFSv4 Chuck Lever
@ 2009-09-02 15:10   ` Steve Dickson
  2009-09-08 18:51   ` Steve Dickson
  5 siblings, 0 replies; 12+ messages in thread
From: Steve Dickson @ 2009-09-02 15:10 UTC (permalink / raw)
  To: Chuck Lever; +Cc: trond.myklebust, linux-nfs

On 09/02/2009 09:51 AM, Chuck Lever wrote:
> Sorry for the repost.  After reading the patch descriptions again, I
> thought they needed some clarification.
> 
> ---
> 
> Chuck Lever (4):
>       NFS: Allow the "nfs" file system type to support NFSv4
>       NFS: Move details of nfs4_get_sb() to a helper
>       NFS: Refactor NFSv4 text-based mount option validation
>       NFS: Mount option parser should detect missing "port="
> 
> 
>  fs/nfs/internal.h    |   10 ++
>  fs/nfs/super.c       |  202 +++++++++++++++++++++++++++++++++-----------------
>  include/linux/nfs4.h |    1 
>  3 files changed, 144 insertions(+), 69 deletions(-)
> 
Trond, is there an ETA on this? 

</rant>
We've turned a simple 2 patch solution into a 4 user
space patches and 4 kernel patches to simply added a
short cut to mount the nfs4 file system... If this not
an example of over engineering then I don't know what its...
</rant>


steved.

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

* Re: [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4]
       [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
                     ` (4 preceding siblings ...)
  2009-09-02 15:10   ` [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4] Steve Dickson
@ 2009-09-08 18:51   ` Steve Dickson
       [not found]     ` <4AA6A7B5.1060301-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
  5 siblings, 1 reply; 12+ messages in thread
From: Steve Dickson @ 2009-09-08 18:51 UTC (permalink / raw)
  To: Chuck Lever; +Cc: trond.myklebust, linux-nfs

On 09/02/2009 09:51 AM, Chuck Lever wrote:
> Sorry for the repost.  After reading the patch descriptions again, I
> thought they needed some clarification.
> 
> ---
> 
> Chuck Lever (4):
>       NFS: Allow the "nfs" file system type to support NFSv4
>       NFS: Move details of nfs4_get_sb() to a helper
>       NFS: Refactor NFSv4 text-based mount option validation
>       NFS: Mount option parser should detect missing "port="
> 
> 
>  fs/nfs/internal.h    |   10 ++
>  fs/nfs/super.c       |  202 +++++++++++++++++++++++++++++++++-----------------
>  include/linux/nfs4.h |    1 
>  3 files changed, 144 insertions(+), 69 deletions(-)
> 
Trond,

I'm updating the mount.nfs man pages, and would like give 
an guess-ta-mate as to which kernel these patches will be in.
Any ideas?

steved.

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

* Re: [PATCH 4/4] NFS: Allow the "nfs" file system type to support NFSv4
       [not found]     ` <20090902135222.3550.59986.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
@ 2009-09-08 22:17       ` Trond Myklebust
  0 siblings, 0 replies; 12+ messages in thread
From: Trond Myklebust @ 2009-09-08 22:17 UTC (permalink / raw)
  To: Chuck Lever; +Cc: linux-nfs

On Wed, 2009-09-02 at 09:52 -0400, Chuck Lever wrote:
> When mounting an "nfs" type file system, recognize "v4," "vers=4," or
> "nfsvers=4" mount options, and convert the file system to "nfs4" under
> the covers.
> 
> Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
> ---

For consistency, can we please ensure that we set the
nfs_parsed_mount_data->version in the binary mount case too?

The other thing to note is that we should not allow vers=2,3 in the -t
nfs4 case.

I'll fix the former inline in your patch 4/4, and add the latter as a
separate patch.

Cheers
  Trond


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

* Re: [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4]
       [not found]     ` <4AA6A7B5.1060301-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
@ 2009-09-09 17:31       ` Trond Myklebust
       [not found]         ` <1252517471.8722.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  0 siblings, 1 reply; 12+ messages in thread
From: Trond Myklebust @ 2009-09-09 17:31 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Chuck Lever, linux-nfs

On Tue, 2009-09-08 at 14:51 -0400, Steve Dickson wrote:
> On 09/02/2009 09:51 AM, Chuck Lever wrote:
> > Sorry for the repost.  After reading the patch descriptions again, I
> > thought they needed some clarification.
> > 
> > ---
> > 
> > Chuck Lever (4):
> >       NFS: Allow the "nfs" file system type to support NFSv4
> >       NFS: Move details of nfs4_get_sb() to a helper
> >       NFS: Refactor NFSv4 text-based mount option validation
> >       NFS: Mount option parser should detect missing "port="
> > 
> > 
> >  fs/nfs/internal.h    |   10 ++
> >  fs/nfs/super.c       |  202 +++++++++++++++++++++++++++++++++-----------------
> >  include/linux/nfs4.h |    1 
> >  3 files changed, 144 insertions(+), 69 deletions(-)
> > 
> Trond,
> 
> I'm updating the mount.nfs man pages, and would like give 
> an guess-ta-mate as to which kernel these patches will be in.
> Any ideas?

I'm planning on pushing them out in the upcoming merge window, since the
patches themselves seem pretty straightforward. I've applied the fixes
that I suggested, and added the patch to disable vers!=4 in the '-t
nfs4' case.

If you'd like to test it all out, I've pushed those patches into the
nfs-for-2.6.32 branch of my git tree. They should also appear in
linux-next.

Cheers
  Trond
-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

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

* Re: [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4]
       [not found]         ` <1252517471.8722.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
@ 2009-09-09 18:14           ` Steve Dickson
  2009-09-14 18:17           ` Steve Dickson
  1 sibling, 0 replies; 12+ messages in thread
From: Steve Dickson @ 2009-09-09 18:14 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Chuck Lever, linux-nfs



On 09/09/2009 01:31 PM, Trond Myklebust wrote:
> On Tue, 2009-09-08 at 14:51 -0400, Steve Dickson wrote:
>> On 09/02/2009 09:51 AM, Chuck Lever wrote:
>>> Sorry for the repost.  After reading the patch descriptions again, I
>>> thought they needed some clarification.
>>>
>>> ---
>>>
>>> Chuck Lever (4):
>>>       NFS: Allow the "nfs" file system type to support NFSv4
>>>       NFS: Move details of nfs4_get_sb() to a helper
>>>       NFS: Refactor NFSv4 text-based mount option validation
>>>       NFS: Mount option parser should detect missing "port="
>>>
>>>
>>>  fs/nfs/internal.h    |   10 ++
>>>  fs/nfs/super.c       |  202 +++++++++++++++++++++++++++++++++-----------------
>>>  include/linux/nfs4.h |    1 
>>>  3 files changed, 144 insertions(+), 69 deletions(-)
>>>
>> Trond,
>>
>> I'm updating the mount.nfs man pages, and would like give 
>> an guess-ta-mate as to which kernel these patches will be in.
>> Any ideas?
> 
> I'm planning on pushing them out in the upcoming merge window, since the
> patches themselves seem pretty straightforward. I've applied the fixes
> that I suggested, and added the patch to disable vers!=4 in the '-t
> nfs4' case.
> 
> If you'd like to test it all out, I've pushed those patches into the
> nfs-for-2.6.32 branch of my git tree. They should also appear in
> linux-next.
Cool... thanks!

steved.

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

* Re: [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4]
       [not found]         ` <1252517471.8722.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
  2009-09-09 18:14           ` Steve Dickson
@ 2009-09-14 18:17           ` Steve Dickson
       [not found]             ` <4AAE88B8.90908-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
  1 sibling, 1 reply; 12+ messages in thread
From: Steve Dickson @ 2009-09-14 18:17 UTC (permalink / raw)
  To: Trond Myklebust; +Cc: Chuck Lever, linux-nfs

On 09/09/2009 01:31 PM, Trond Myklebust wrote:
> On Tue, 2009-09-08 at 14:51 -0400, Steve Dickson wrote:
>> On 09/02/2009 09:51 AM, Chuck Lever wrote:
>>> Sorry for the repost.  After reading the patch descriptions again, I
>>> thought they needed some clarification.
>>>
>>> ---
>>>
>>> Chuck Lever (4):
>>>       NFS: Allow the "nfs" file system type to support NFSv4
>>>       NFS: Move details of nfs4_get_sb() to a helper
>>>       NFS: Refactor NFSv4 text-based mount option validation
>>>       NFS: Mount option parser should detect missing "port="
>>>
>>>
>>>  fs/nfs/internal.h    |   10 ++
>>>  fs/nfs/super.c       |  202 +++++++++++++++++++++++++++++++++-----------------
>>>  include/linux/nfs4.h |    1 These patches (after a bit of back porting) are now in the F-12 and Rawhide 
kernels, 
>>>  3 files changed, 144 insertions(+), 69 deletions(-)
>>>
>> Trond,
>>
>> I'm updating the mount.nfs man pages, and would like give 
>> an guess-ta-mate as to which kernel these patches will be in.
>> Any ideas?
> 
> I'm planning on pushing them out in the upcoming merge window, since the
> patches themselves seem pretty straightforward. I've applied the fixes
> that I suggested, and added the patch to disable vers!=4 in the '-t
> nfs4' case.
> 
> If you'd like to test it all out, I've pushed those patches into the
> nfs-for-2.6.32 branch of my git tree. They should also appear in
> linux-next.
After a weekend of testing these patches along with Chunk's mount.nfs 
patches, I committed these patches (after some back porting) to both 
the Fedora F-12 and Rawhide kernels, which means they will get plenty 
of testing by the time 2.6.32 rolls around...

steved.

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

* Re: [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4]
       [not found]             ` <4AAE88B8.90908-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
@ 2009-09-14 18:28               ` Trond Myklebust
  0 siblings, 0 replies; 12+ messages in thread
From: Trond Myklebust @ 2009-09-14 18:28 UTC (permalink / raw)
  To: Steve Dickson; +Cc: Chuck Lever, linux-nfs

On Mon, 2009-09-14 at 14:17 -0400, Steve Dickson wrote:
> On 09/09/2009 01:31 PM, Trond Myklebust wrote:
> > On Tue, 2009-09-08 at 14:51 -0400, Steve Dickson wrote:
> >> On 09/02/2009 09:51 AM, Chuck Lever wrote:
> >>> Sorry for the repost.  After reading the patch descriptions again, I
> >>> thought they needed some clarification.
> >>>
> >>> ---
> >>>
> >>> Chuck Lever (4):
> >>>       NFS: Allow the "nfs" file system type to support NFSv4
> >>>       NFS: Move details of nfs4_get_sb() to a helper
> >>>       NFS: Refactor NFSv4 text-based mount option validation
> >>>       NFS: Mount option parser should detect missing "port="
> >>>
> >>>
> >>>  fs/nfs/internal.h    |   10 ++
> >>>  fs/nfs/super.c       |  202 +++++++++++++++++++++++++++++++++-----------------
> >>>  include/linux/nfs4.h |    1 These patches (after a bit of back porting) are now in the F-12 and Rawhide 
> kernels, 
> >>>  3 files changed, 144 insertions(+), 69 deletions(-)
> >>>
> >> Trond,
> >>
> >> I'm updating the mount.nfs man pages, and would like give 
> >> an guess-ta-mate as to which kernel these patches will be in.
> >> Any ideas?
> > 
> > I'm planning on pushing them out in the upcoming merge window, since the
> > patches themselves seem pretty straightforward. I've applied the fixes
> > that I suggested, and added the patch to disable vers!=4 in the '-t
> > nfs4' case.
> > 
> > If you'd like to test it all out, I've pushed those patches into the
> > nfs-for-2.6.32 branch of my git tree. They should also appear in
> > linux-next.
> After a weekend of testing these patches along with Chunk's mount.nfs 
> patches, I committed these patches (after some back porting) to both 
> the Fedora F-12 and Rawhide kernels, which means they will get plenty 
> of testing by the time 2.6.32 rolls around...

Thanks! I've already pushed them upstream to Linus.

Cheers
  Trond

-- 
Trond Myklebust
Linux NFS client maintainer

NetApp
Trond.Myklebust@netapp.com
www.netapp.com

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

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

Thread overview: 12+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-09-02 13:51 [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4] Chuck Lever
     [not found] ` <20090902135032.3550.23170.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-09-02 13:52   ` [PATCH 1/4] NFS: Mount option parser should detect missing "port=" Chuck Lever
2009-09-02 13:52   ` [PATCH 2/4] NFS: Refactor NFSv4 text-based mount option validation Chuck Lever
2009-09-02 13:52   ` [PATCH 3/4] NFS: Move details of nfs4_get_sb() to a helper Chuck Lever
2009-09-02 13:52   ` [PATCH 4/4] NFS: Allow the "nfs" file system type to support NFSv4 Chuck Lever
     [not found]     ` <20090902135222.3550.59986.stgit-RytpoXr2tKZ9HhUboXbp9zCvJB+x5qRC@public.gmane.org>
2009-09-08 22:17       ` Trond Myklebust
2009-09-02 15:10   ` [PATCH 0/4] Support "-t nfs,vers=4" mounts in the kernel [take 4] Steve Dickson
2009-09-08 18:51   ` Steve Dickson
     [not found]     ` <4AA6A7B5.1060301-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-09-09 17:31       ` Trond Myklebust
     [not found]         ` <1252517471.8722.19.camel-rJ7iovZKK19ZJLDQqaL3InhyD016LWXt@public.gmane.org>
2009-09-09 18:14           ` Steve Dickson
2009-09-14 18:17           ` Steve Dickson
     [not found]             ` <4AAE88B8.90908-AfCzQyP5zfLQT0dZR+AlfA@public.gmane.org>
2009-09-14 18:28               ` Trond Myklebust

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).