diff mbox

[2/2] NFSDv4.2: Added NFS v4.2 support to the NFS server

Message ID 1361552981-29385-3-git-send-email-steved@redhat.com (mailing list archive)
State New, archived
Headers show

Commit Message

Steve Dickson Feb. 22, 2013, 5:09 p.m. UTC
This enable NFSv4.2 support for the server. To enable this
code do the following:
  echo "+4.2" >/proc/fs/nfsd/versions

after the nfsd kernel module is loaded.

Signed-off-by: Steve Dickson <steved@redhat.com>
---
 fs/nfsd/nfs4state.c | 2 +-
 fs/nfsd/nfs4xdr.c   | 1 +
 fs/nfsd/nfsd.h      | 2 +-
 fs/nfsd/state.h     | 2 +-
 4 files changed, 4 insertions(+), 3 deletions(-)

Comments

J. Bruce Fields Feb. 22, 2013, 6:05 p.m. UTC | #1
On Fri, Feb 22, 2013 at 12:09:41PM -0500, Steve Dickson wrote:
> This enable NFSv4.2 support for the server. To enable this
> code do the following:
>   echo "+4.2" >/proc/fs/nfsd/versions

Give it a config option and we're set....

--b.

> 
> after the nfsd kernel module is loaded.
> 
> Signed-off-by: Steve Dickson <steved@redhat.com>
> ---
>  fs/nfsd/nfs4state.c | 2 +-
>  fs/nfsd/nfs4xdr.c   | 1 +
>  fs/nfsd/nfsd.h      | 2 +-
>  fs/nfsd/state.h     | 2 +-
>  4 files changed, 4 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
> index ac8ed96..947c550 100644
> --- a/fs/nfsd/nfs4state.c
> +++ b/fs/nfsd/nfs4state.c
> @@ -1678,7 +1678,7 @@ out_new:
>  		status = nfserr_jukebox;
>  		goto out;
>  	}
> -	new->cl_minorversion = 1;
> +	new->cl_minorversion = cstate->minorversion;
>  
>  	gen_clid(new, nn);
>  	add_to_unconfirmed(new);
> diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
> index d2ae8db..86be853 100644
> --- a/fs/nfsd/nfs4xdr.c
> +++ b/fs/nfsd/nfs4xdr.c
> @@ -1621,6 +1621,7 @@ struct nfsd4_minorversion_ops {
>  static struct nfsd4_minorversion_ops nfsd4_minorversion[] = {
>  	[0] = { nfsd4_dec_ops, ARRAY_SIZE(nfsd4_dec_ops) },
>  	[1] = { nfsd41_dec_ops, ARRAY_SIZE(nfsd41_dec_ops) },
> +	[2] = { nfsd41_dec_ops, ARRAY_SIZE(nfsd41_dec_ops) },
>  };
>  
>  static __be32
> diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
> index 26a457b..0e3ccd1 100644
> --- a/fs/nfsd/nfsd.h
> +++ b/fs/nfsd/nfsd.h
> @@ -24,7 +24,7 @@
>  /*
>   * nfsd version
>   */
> -#define NFSD_SUPPORTED_MINOR_VERSION	1
> +#define NFSD_SUPPORTED_MINOR_VERSION	2
>  /*
>   * Maximum blocksizes supported by daemon under various circumstances.
>   */
> diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
> index d1c229f..de9416b 100644
> --- a/fs/nfsd/state.h
> +++ b/fs/nfsd/state.h
> @@ -108,7 +108,7 @@ struct nfs4_cb_conn {
>  	u32                     cb_prog; /* used only in 4.0 case;
>  					    per-session otherwise */
>  	u32                     cb_ident;	/* minorversion 0 only */
> -	struct svc_xprt		*cb_xprt;	/* minorversion 1 only */
> +	struct svc_xprt		*cb_xprt;	/* minorversion >= 1 only */
>  };
>  
>  static inline struct nfs4_delegation *delegstateid(struct nfs4_stid *s)
> -- 
> 1.8.1.2
> 
> --
> To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at  http://vger.kernel.org/majordomo-info.html
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Bruce Fields Feb. 22, 2013, 6:10 p.m. UTC | #2
On Fri, Feb 22, 2013 at 01:05:15PM -0500, J. Bruce Fields wrote:
> On Fri, Feb 22, 2013 at 12:09:41PM -0500, Steve Dickson wrote:
> > This enable NFSv4.2 support for the server. To enable this
> > code do the following:
> >   echo "+4.2" >/proc/fs/nfsd/versions
> 
> Give it a config option and we're set....

Also, while you're testing these: worth firing up wireshark and checking
that "2"'s actually being sent in minorversion field, both on ordinary
compounds and on callbacks.

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Dickson Feb. 23, 2013, 12:43 p.m. UTC | #3
On 22/02/13 13:05, J. Bruce Fields wrote:
> On Fri, Feb 22, 2013 at 12:09:41PM -0500, Steve Dickson wrote:
>> > This enable NFSv4.2 support for the server. To enable this
>> > code do the following:
>> >   echo "+4.2" >/proc/fs/nfsd/versions
> Give it a config option and we're set....
I didn't a config option in fs/nfsd/Kconfig for 4.1 which is 
the reason I didn't add one for 4.2... Should I add both?

steved.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J. Bruce Fields Feb. 23, 2013, 1 p.m. UTC | #4
On Sat, Feb 23, 2013 at 07:43:43AM -0500, Steve Dickson wrote:
> 
> 
> On 22/02/13 13:05, J. Bruce Fields wrote:
> > On Fri, Feb 22, 2013 at 12:09:41PM -0500, Steve Dickson wrote:
> >> > This enable NFSv4.2 support for the server. To enable this
> >> > code do the following:
> >> >   echo "+4.2" >/proc/fs/nfsd/versions
> > Give it a config option and we're set....
> I didn't a config option in fs/nfsd/Kconfig for 4.1 which is 
> the reason I didn't add one for 4.2... Should I add both?

Well.... I guess if it defaults to off at runtime, and if there's a
config option for labeled NFS--maybe there's no harm to it.  At worst
somebody turns on 4.2 by option but hey it should be fully
spec-compliant as 4.2 is only optional stuff.

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
J. Bruce Fields Feb. 23, 2013, 1:01 p.m. UTC | #5
On Sat, Feb 23, 2013 at 08:00:56AM -0500, J. Bruce Fields wrote:
> On Sat, Feb 23, 2013 at 07:43:43AM -0500, Steve Dickson wrote:
> > 
> > 
> > On 22/02/13 13:05, J. Bruce Fields wrote:
> > > On Fri, Feb 22, 2013 at 12:09:41PM -0500, Steve Dickson wrote:
> > >> > This enable NFSv4.2 support for the server. To enable this
> > >> > code do the following:
> > >> >   echo "+4.2" >/proc/fs/nfsd/versions
> > > Give it a config option and we're set....
> > I didn't a config option in fs/nfsd/Kconfig for 4.1 which is 
> > the reason I didn't add one for 4.2... Should I add both?
> 
> Well.... I guess if it defaults to off at runtime, and if there's a
> config option for labeled NFS--maybe there's no harm to it.  At worst
> somebody turns on 4.2 by option but hey it should be fully
> spec-compliant as 4.2 is only optional stuff.

(In other words: OK, OK, never mind, we can do without!)

--b.
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Steve Dickson Feb. 23, 2013, 2:49 p.m. UTC | #6
On 22/02/13 13:10, J. Bruce Fields wrote:
> On Fri, Feb 22, 2013 at 01:05:15PM -0500, J. Bruce Fields wrote:
>> On Fri, Feb 22, 2013 at 12:09:41PM -0500, Steve Dickson wrote:
>>> This enable NFSv4.2 support for the server. To enable this
>>> code do the following:
>>>   echo "+4.2" >/proc/fs/nfsd/versions
>>
>> Give it a config option and we're set....
> 
> Also, while you're testing these: worth firing up wireshark and checking
> that "2"'s actually being sent in minorversion field, both on ordinary
> compounds and on callbacks.
I just confirmed with these latest bits, minorversion is definitely getting
set to "2".

steved.
  
--
To unsubscribe from this list: send the line "unsubscribe linux-nfs" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

diff --git a/fs/nfsd/nfs4state.c b/fs/nfsd/nfs4state.c
index ac8ed96..947c550 100644
--- a/fs/nfsd/nfs4state.c
+++ b/fs/nfsd/nfs4state.c
@@ -1678,7 +1678,7 @@  out_new:
 		status = nfserr_jukebox;
 		goto out;
 	}
-	new->cl_minorversion = 1;
+	new->cl_minorversion = cstate->minorversion;
 
 	gen_clid(new, nn);
 	add_to_unconfirmed(new);
diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index d2ae8db..86be853 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -1621,6 +1621,7 @@  struct nfsd4_minorversion_ops {
 static struct nfsd4_minorversion_ops nfsd4_minorversion[] = {
 	[0] = { nfsd4_dec_ops, ARRAY_SIZE(nfsd4_dec_ops) },
 	[1] = { nfsd41_dec_ops, ARRAY_SIZE(nfsd41_dec_ops) },
+	[2] = { nfsd41_dec_ops, ARRAY_SIZE(nfsd41_dec_ops) },
 };
 
 static __be32
diff --git a/fs/nfsd/nfsd.h b/fs/nfsd/nfsd.h
index 26a457b..0e3ccd1 100644
--- a/fs/nfsd/nfsd.h
+++ b/fs/nfsd/nfsd.h
@@ -24,7 +24,7 @@ 
 /*
  * nfsd version
  */
-#define NFSD_SUPPORTED_MINOR_VERSION	1
+#define NFSD_SUPPORTED_MINOR_VERSION	2
 /*
  * Maximum blocksizes supported by daemon under various circumstances.
  */
diff --git a/fs/nfsd/state.h b/fs/nfsd/state.h
index d1c229f..de9416b 100644
--- a/fs/nfsd/state.h
+++ b/fs/nfsd/state.h
@@ -108,7 +108,7 @@  struct nfs4_cb_conn {
 	u32                     cb_prog; /* used only in 4.0 case;
 					    per-session otherwise */
 	u32                     cb_ident;	/* minorversion 0 only */
-	struct svc_xprt		*cb_xprt;	/* minorversion 1 only */
+	struct svc_xprt		*cb_xprt;	/* minorversion >= 1 only */
 };
 
 static inline struct nfs4_delegation *delegstateid(struct nfs4_stid *s)