All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4
@ 2015-07-28 11:46 Kinglong Mee
  2015-07-29 19:37 ` J. Bruce Fields
  0 siblings, 1 reply; 8+ messages in thread
From: Kinglong Mee @ 2015-07-28 11:46 UTC (permalink / raw)
  To: J. Bruce Fields, linux-nfs@vger.kernel.org; +Cc: tigran.mkrtchyan, kinglongmee

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 nfs4.1/xdrdef/nfs4.x | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
index 024e0b4..cb3db7e 100644
--- a/nfs4.1/xdrdef/nfs4.x
+++ b/nfs4.1/xdrdef/nfs4.x
@@ -852,7 +852,7 @@ typedef change_policy4  fattr4_change_policy;
 typedef uint64_t        fattr_space_freed;
 typedef change_attr_type4
                 fattr4_change_attr_type;
-typedef sec_label4      fattr_sec_label<>;
+typedef sec_label4      fattr4_sec_label;
 
 %/*
 % * REQUIRED Attributes
-- 
2.4.3


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

* Re: [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4
  2015-07-28 11:46 [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4 Kinglong Mee
@ 2015-07-29 19:37 ` J. Bruce Fields
  2015-07-30 12:05   ` Kinglong Mee
  0 siblings, 1 reply; 8+ messages in thread
From: J. Bruce Fields @ 2015-07-29 19:37 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: linux-nfs@vger.kernel.org, tigran.mkrtchyan

On Tue, Jul 28, 2015 at 07:46:35PM +0800, Kinglong Mee wrote:
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---

See nfs4.1/xdrdef/README and please update that README and nfs4.x.diff
too if necessary (and report to nfsv4@ietf.org if this is still a bug in
the minorversion 2 draft).

--b.

>  nfs4.1/xdrdef/nfs4.x | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
> index 024e0b4..cb3db7e 100644
> --- a/nfs4.1/xdrdef/nfs4.x
> +++ b/nfs4.1/xdrdef/nfs4.x
> @@ -852,7 +852,7 @@ typedef change_policy4  fattr4_change_policy;
>  typedef uint64_t        fattr_space_freed;
>  typedef change_attr_type4
>                  fattr4_change_attr_type;
> -typedef sec_label4      fattr_sec_label<>;
> +typedef sec_label4      fattr4_sec_label;
>  
>  %/*
>  % * REQUIRED Attributes
> -- 
> 2.4.3

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

* Re: [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4
  2015-07-29 19:37 ` J. Bruce Fields
@ 2015-07-30 12:05   ` Kinglong Mee
  2015-07-30 12:13     ` [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt Kinglong Mee
                       ` (3 more replies)
  0 siblings, 4 replies; 8+ messages in thread
From: Kinglong Mee @ 2015-07-30 12:05 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs@vger.kernel.org, tigran.mkrtchyan, kinglongmee

On 7/30/2015 03:37, J. Bruce Fields wrote:
> On Tue, Jul 28, 2015 at 07:46:35PM +0800, Kinglong Mee wrote:
>> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
>> ---
> 
> See nfs4.1/xdrdef/README and please update that README and nfs4.x.diff
> too if necessary (and report to nfsv4@ietf.org if this is still a bug in
> the minorversion 2 draft).

Description at,
https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-38#section-12.2.4

"The FATTR4_SEC_LABEL contains an array of two components with the
 first component being an LFS."

It seems both nfs server and client have wrong implement, not the rfc's bug.

xdrdef/nfs4.x is out of date, just update it.

thanks,
Kinglong Mee

> 
> --b.
> 
>>  nfs4.1/xdrdef/nfs4.x | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
>> index 024e0b4..cb3db7e 100644
>> --- a/nfs4.1/xdrdef/nfs4.x
>> +++ b/nfs4.1/xdrdef/nfs4.x
>> @@ -852,7 +852,7 @@ typedef change_policy4  fattr4_change_policy;
>>  typedef uint64_t        fattr_space_freed;
>>  typedef change_attr_type4
>>                  fattr4_change_attr_type;
>> -typedef sec_label4      fattr_sec_label<>;
>> +typedef sec_label4      fattr4_sec_label;
>>  
>>  %/*
>>  % * REQUIRED Attributes
>> -- 
>> 2.4.3
> 

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

* [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt
  2015-07-30 12:05   ` Kinglong Mee
@ 2015-07-30 12:13     ` Kinglong Mee
  2015-08-18 19:27       ` J. Bruce Fields
  2015-07-30 14:22     ` [PATCH] NFSD: Encode security label as an array Kinglong Mee
                       ` (2 subsequent siblings)
  3 siblings, 1 reply; 8+ messages in thread
From: Kinglong Mee @ 2015-07-30 12:13 UTC (permalink / raw)
  To: J. Bruce Fields; +Cc: linux-nfs@vger.kernel.org, tigran.mkrtchyan, kinglongmee

There are some updates and bugfixes between draft-ietf-nfsv4-minorversion2-dot-x-38.txt
 and draft-ietf-nfsv4-minorversion2-dot-x-30.txt.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 nfs4.1/xdrdef/README |   2 +-
 nfs4.1/xdrdef/nfs4.x | 108 +++++++++++++++++++++++++++++++++++++++++++--------
 2 files changed, 92 insertions(+), 18 deletions(-)

diff --git a/nfs4.1/xdrdef/README b/nfs4.1/xdrdef/README
index 2d57ee1..c39fd43 100644
--- a/nfs4.1/xdrdef/README
+++ b/nfs4.1/xdrdef/README
@@ -1,4 +1,4 @@
 # Note nfs4.x was created using:
 
-curl http://www.ietf.org/id/draft-ietf-nfsv4-minorversion2-dot-x-30.txt|grep "^  *///" | sed 's?^  */// ??' | sed 's?^  *///$??' >nfs4.1/xdrdef/nfs4.x
+curl http://www.ietf.org/id/draft-ietf-nfsv4-minorversion2-dot-x-38.txt|grep "^  *///" | sed 's?^  */// ??' | sed 's?^  *///$??' >nfs4.1/xdrdef/nfs4.x
 patch nfs4.1/xdrdef/nfs4.x <nfs4.1/xdrdef/nfs4.x.diff 
diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
index 024e0b4..23c6d7c 100644
--- a/nfs4.1/xdrdef/nfs4.x
+++ b/nfs4.1/xdrdef/nfs4.x
@@ -1,8 +1,53 @@
 /*
- * This file was machine generated for
- *  draft-ietf-nfsv4-minorversion2-30
- * Last updated Wed Jan 21 09:59:04 PST 2015
+ * This file was machine generated for [draft-ietf-nfsv4-minorversion2-38].
+ *
+ * Last updated Tue Apr 28 09:46:23 PDT 2015
  */
+
+/*
+ * Copyright (c) 2015 IETF Trust and the persons identified
+ * as the document authors.  All rights reserved.
+ *
+ * The Redistribution and use in source and binary forms, with
+ * or without modification, are permitted provided that the
+ * following conditions are met:
+ *
+ * - Redistributions of source code must retain the above
+ *   copyright notice, this list of conditions and the
+ *   following disclaimer.
+ *
+ * - Redistributions in binary form must reproduce the above
+ *   copyright notice, this list of conditions and the
+ *   following disclaimer in the documentation and/or other
+ *   materials provided with the distribution.
+ *
+ * - Neither the name of Internet Society Society, IETF or IETF
+ *   Trust, nor the names of specific contributors, may be
+ *   used to endorse or promote products derived from this
+ *   software without specific prior written permission.
+ *
+ *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
+ *   AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
+ *   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ *   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
+ *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
+ *   EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
+ *   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
+ *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
+ *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
+ *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
+ *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
+ *   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
+ *   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+ */
+
+/*
+ * This code was derived from [draft-ietf-nfsv4-minorversion2-dot-x-38].
+ */
+
 /*
  *  Copyright (C) The IETF Trust (2007-2014)
  *  All Rights Reserved.
@@ -667,9 +712,9 @@ typedef uint32_t        fs_charset_cap4;
  */
 
 enum netloc_type4 {
-        NL4_NAME        = 0,
-        NL4_URL         = 1,
-        NL4_NETADDR     = 2
+        NL4_NAME        = 1,
+        NL4_URL         = 2,
+        NL4_NETADDR     = 3
 };
 union netloc4 switch (netloc_type4 nl_type) {
         case NL4_NAME:          utf8str_cis nl_name;
@@ -849,10 +894,11 @@ typedef change_policy4  fattr4_change_policy;
 /*
  * attributes new to NFSv4.2
  */
-typedef uint64_t        fattr_space_freed;
+typedef uint64_t        fattr4_space_freed;
 typedef change_attr_type4
                 fattr4_change_attr_type;
-typedef sec_label4      fattr_sec_label<>;
+typedef sec_label4      fattr4_sec_label<>;
+typedef uint32_t        fattr4_clone_blksize;
 
 %/*
 % * REQUIRED Attributes
@@ -931,10 +977,6 @@ const FATTR4_DIRENT_NOTIF_DELAY = 57;
 const FATTR4_DACL               = 58;
 const FATTR4_SACL               = 59;
 const FATTR4_CHANGE_POLICY      = 60;
-
-%/*
-% * new to NFSV4.2
-% */
 const FATTR4_FS_STATUS          = 61;
 const FATTR4_FS_LAYOUT_TYPES    = 62;
 const FATTR4_LAYOUT_HINT        = 63;
@@ -950,7 +992,11 @@ const FATTR4_RETENTEVT_SET      = 72;
 const FATTR4_RETENTION_HOLD     = 73;
 const FATTR4_MODE_SET_MASKED    = 74;
 const FATTR4_FS_CHARSET_CAP     = 76;
-/* 77 is currently unused */
+
+%/*
+% * new to NFSV4.2
+% */
+const FATTR4_CLONE_BLKSIZE      = 77;
 const FATTR4_SPACE_FREED        = 78;
 const FATTR4_CHANGE_ATTR_TYPE   = 79;
 const FATTR4_SEC_LABEL          = 80;
@@ -1287,6 +1333,7 @@ enum nfs_opnum4 {
  OP_READ_PLUS           = 68,
  OP_SEEK                = 69,
  OP_WRITE_SAME          = 70,
+ OP_CLONE               = 71,
  OP_ILLEGAL             = 10044
 };
 
@@ -1316,6 +1363,19 @@ union ACCESS4res switch (nfsstat4 status) {
         void;
 };
 
+struct CLONE4args {
+        /* SAVED_FH: source file */
+        /* CURRENT_FH: destination file */
+        stateid4        cl_src_stateid;
+        stateid4        cl_dst_stateid;
+        offset4         cl_src_offset;
+        offset4         cl_dst_offset;
+        length4         cl_count;
+};
+
+struct CLONE4res {
+        nfsstat4        cl_status;
+};
 struct CLOSE4args {
         /* CURRENT_FH: object */
         seqid4          seqid;
@@ -2759,13 +2819,24 @@ struct COPY4args {
 };
 
 
-struct COPY4res {
-        nfsstat4        cr_status;
-        write_response4 cr_response;
+struct copy_requirements4 {
         bool            cr_consecutive;
         bool            cr_synchronous;
 };
 
+struct COPY4resok {
+        write_response4         cr_response;
+        copy_requirements4      cr_requirements;
+};
+
+union COPY4res switch (nfsstat4 cr_status) {
+case NFS4_OK:
+        COPY4resok              cr_resok4;
+case NFS4ERR_OFFLOAD_NO_REQS:
+        copy_requirements4      cr_requirements;
+default:
+        void;
+};
 
 struct COPY_NOTIFY4args {
         /* CURRENT_FH: source file */
@@ -2775,6 +2846,7 @@ struct COPY_NOTIFY4args {
 
 struct COPY_NOTIFY4resok {
         nfstime4        cnr_lease_time;
+        stateid4        cnr_stateid;
         netloc4         cnr_source_server<>;
 };
 
@@ -2887,7 +2959,7 @@ struct LAYOUTERROR4res {
 };
 
 struct io_info4 {
-        uint32_t        ii_count;
+        uint64_t        ii_count;
         uint64_t        ii_bytes;
 };
 
@@ -3088,6 +3160,7 @@ union nfs_argop4 switch (nfs_opnum4 argop) {
  case OP_READ_PLUS:     READ_PLUS4args opread_plus;
  case OP_SEEK:          SEEK4args opseek;
  case OP_WRITE_SAME:    WRITE_SAME4args opwrite_same;
+ case OP_CLONE:         CLONE4args opclone;
 
  /* Operations not new to NFSv4.1 */
  case OP_ILLEGAL:       void;
@@ -3216,6 +3289,7 @@ union nfs_resop4 switch (nfs_opnum4 resop) {
  case OP_READ_PLUS:     READ_PLUS4res opread_plus;
  case OP_SEEK:          SEEK4res opseek;
  case OP_WRITE_SAME:    WRITE_SAME4res opwrite_same;
+ case OP_CLONE:         CLONE4res opclone;
 
  /* Operations not new to NFSv4.1 */
  case OP_ILLEGAL:       ILLEGAL4res opillegal;
-- 
2.4.3


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

* [PATCH] NFSD: Encode security label as an array
  2015-07-30 12:05   ` Kinglong Mee
  2015-07-30 12:13     ` [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt Kinglong Mee
@ 2015-07-30 14:22     ` Kinglong Mee
  2015-07-30 14:22     ` [PATCH] NFS: Decode " Kinglong Mee
  2015-07-30 15:48     ` [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4 J. Bruce Fields
  3 siblings, 0 replies; 8+ messages in thread
From: Kinglong Mee @ 2015-07-30 14:22 UTC (permalink / raw)
  To: J. Bruce Fields
  Cc: linux-nfs@vger.kernel.org, tigran.mkrtchyan, kinglongmee,
	Trond Myklebust

According at,
https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-38#section-12.2.4

"The FATTR4_SEC_LABEL contains an array of two components with the
 first component being an LFS."

Only supports one security label now.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfsd/nfs4xdr.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfsd/nfs4xdr.c b/fs/nfsd/nfs4xdr.c
index 5463385..fac05f9 100644
--- a/fs/nfsd/nfs4xdr.c
+++ b/fs/nfsd/nfs4xdr.c
@@ -2151,10 +2151,11 @@ nfsd4_encode_security_label(struct xdr_stream *xdr, struct svc_rqst *rqstp,
 {
 	__be32 *p;
 
-	p = xdr_reserve_space(xdr, len + 4 + 4 + 4);
+	p = xdr_reserve_space(xdr, len + 16);
 	if (!p)
 		return nfserr_resource;
 
+	*p++ = cpu_to_be32(1); /* Supports only one security label now */
 	/*
 	 * For now we use a 0 here to indicate the null translation; in
 	 * the future we may place a call to translation code here.
-- 
2.4.3


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

* [PATCH] NFS: Decode security label as an array
  2015-07-30 12:05   ` Kinglong Mee
  2015-07-30 12:13     ` [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt Kinglong Mee
  2015-07-30 14:22     ` [PATCH] NFSD: Encode security label as an array Kinglong Mee
@ 2015-07-30 14:22     ` Kinglong Mee
  2015-07-30 15:48     ` [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4 J. Bruce Fields
  3 siblings, 0 replies; 8+ messages in thread
From: Kinglong Mee @ 2015-07-30 14:22 UTC (permalink / raw)
  To: Trond Myklebust
  Cc: J. Bruce Fields, linux-nfs@vger.kernel.org, tigran.mkrtchyan,
	kinglongmee

According at,
https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-38#section-12.2.4

"The FATTR4_SEC_LABEL contains an array of two components with the
 first component being an LFS."

So, the security label returned from server should be stored in an array.

Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
---
 fs/nfs/nfs4xdr.c | 18 +++++++++++-------
 1 file changed, 11 insertions(+), 7 deletions(-)

diff --git a/fs/nfs/nfs4xdr.c b/fs/nfs/nfs4xdr.c
index 558cd65d..d8a35d2 100644
--- a/fs/nfs/nfs4xdr.c
+++ b/fs/nfs/nfs4xdr.c
@@ -4114,17 +4114,21 @@ static int decode_attr_security_label(struct xdr_stream *xdr, uint32_t *bitmap,
 	if (unlikely(bitmap[2] & (FATTR4_WORD2_SECURITY_LABEL - 1U)))
 		return -EIO;
 	if (likely(bitmap[2] & FATTR4_WORD2_SECURITY_LABEL)) {
-		p = xdr_inline_decode(xdr, 4);
+		uint32_t dummy;
+
+		p = xdr_inline_decode(xdr, 16);
 		if (unlikely(!p))
 			goto out_overflow;
-		lfs = be32_to_cpup(p++);
-		p = xdr_inline_decode(xdr, 4);
-		if (unlikely(!p))
+
+		dummy = be32_to_cpup(p++);
+		if (dummy != 1) {
+			printk(KERN_WARNING "%s: More than one labels (%u)!",
+				__func__, dummy);
 			goto out_overflow;
+		}
+
+		lfs = be32_to_cpup(p++);
 		pi = be32_to_cpup(p++);
-		p = xdr_inline_decode(xdr, 4);
-		if (unlikely(!p))
-			goto out_overflow;
 		len = be32_to_cpup(p++);
 		p = xdr_inline_decode(xdr, len);
 		if (unlikely(!p))
-- 
2.4.3


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

* Re: [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4
  2015-07-30 12:05   ` Kinglong Mee
                       ` (2 preceding siblings ...)
  2015-07-30 14:22     ` [PATCH] NFS: Decode " Kinglong Mee
@ 2015-07-30 15:48     ` J. Bruce Fields
  3 siblings, 0 replies; 8+ messages in thread
From: J. Bruce Fields @ 2015-07-30 15:48 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: linux-nfs@vger.kernel.org, tigran.mkrtchyan

On Thu, Jul 30, 2015 at 08:05:32PM +0800, Kinglong Mee wrote:
> On 7/30/2015 03:37, J. Bruce Fields wrote:
> > On Tue, Jul 28, 2015 at 07:46:35PM +0800, Kinglong Mee wrote:
> >> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> >> ---
> > 
> > See nfs4.1/xdrdef/README and please update that README and nfs4.x.diff
> > too if necessary (and report to nfsv4@ietf.org if this is still a bug in
> > the minorversion 2 draft).
> 
> Description at,
> https://tools.ietf.org/html/draft-ietf-nfsv4-minorversion2-38#section-12.2.4
> 
> "The FATTR4_SEC_LABEL contains an array of two components with the
>  first component being an LFS."
> 
> It seems both nfs server and client have wrong implement, not the rfc's bug.

It looks like an rfc bug to me.  Doesn't it have conflicting definitions
for sec_label4?

--b.

> 
> xdrdef/nfs4.x is out of date, just update it.
> 
> thanks,
> Kinglong Mee
> 
> > 
> > --b.
> > 
> >>  nfs4.1/xdrdef/nfs4.x | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
> >> index 024e0b4..cb3db7e 100644
> >> --- a/nfs4.1/xdrdef/nfs4.x
> >> +++ b/nfs4.1/xdrdef/nfs4.x
> >> @@ -852,7 +852,7 @@ typedef change_policy4  fattr4_change_policy;
> >>  typedef uint64_t        fattr_space_freed;
> >>  typedef change_attr_type4
> >>                  fattr4_change_attr_type;
> >> -typedef sec_label4      fattr_sec_label<>;
> >> +typedef sec_label4      fattr4_sec_label;
> >>  
> >>  %/*
> >>  % * REQUIRED Attributes
> >> -- 
> >> 2.4.3
> > 

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

* Re: [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt
  2015-07-30 12:13     ` [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt Kinglong Mee
@ 2015-08-18 19:27       ` J. Bruce Fields
  0 siblings, 0 replies; 8+ messages in thread
From: J. Bruce Fields @ 2015-08-18 19:27 UTC (permalink / raw)
  To: Kinglong Mee; +Cc: linux-nfs@vger.kernel.org, tigran.mkrtchyan

On Thu, Jul 30, 2015 at 08:13:22PM +0800, Kinglong Mee wrote:
> There are some updates and bugfixes between draft-ietf-nfsv4-minorversion2-dot-x-38.txt
>  and draft-ietf-nfsv4-minorversion2-dot-x-30.txt.

Applied, thanks.--b.

> 
> Signed-off-by: Kinglong Mee <kinglongmee@gmail.com>
> ---
>  nfs4.1/xdrdef/README |   2 +-
>  nfs4.1/xdrdef/nfs4.x | 108 +++++++++++++++++++++++++++++++++++++++++++--------
>  2 files changed, 92 insertions(+), 18 deletions(-)
> 
> diff --git a/nfs4.1/xdrdef/README b/nfs4.1/xdrdef/README
> index 2d57ee1..c39fd43 100644
> --- a/nfs4.1/xdrdef/README
> +++ b/nfs4.1/xdrdef/README
> @@ -1,4 +1,4 @@
>  # Note nfs4.x was created using:
>  
> -curl http://www.ietf.org/id/draft-ietf-nfsv4-minorversion2-dot-x-30.txt|grep "^  *///" | sed 's?^  */// ??' | sed 's?^  *///$??' >nfs4.1/xdrdef/nfs4.x
> +curl http://www.ietf.org/id/draft-ietf-nfsv4-minorversion2-dot-x-38.txt|grep "^  *///" | sed 's?^  */// ??' | sed 's?^  *///$??' >nfs4.1/xdrdef/nfs4.x
>  patch nfs4.1/xdrdef/nfs4.x <nfs4.1/xdrdef/nfs4.x.diff 
> diff --git a/nfs4.1/xdrdef/nfs4.x b/nfs4.1/xdrdef/nfs4.x
> index 024e0b4..23c6d7c 100644
> --- a/nfs4.1/xdrdef/nfs4.x
> +++ b/nfs4.1/xdrdef/nfs4.x
> @@ -1,8 +1,53 @@
>  /*
> - * This file was machine generated for
> - *  draft-ietf-nfsv4-minorversion2-30
> - * Last updated Wed Jan 21 09:59:04 PST 2015
> + * This file was machine generated for [draft-ietf-nfsv4-minorversion2-38].
> + *
> + * Last updated Tue Apr 28 09:46:23 PDT 2015
>   */
> +
> +/*
> + * Copyright (c) 2015 IETF Trust and the persons identified
> + * as the document authors.  All rights reserved.
> + *
> + * The Redistribution and use in source and binary forms, with
> + * or without modification, are permitted provided that the
> + * following conditions are met:
> + *
> + * - Redistributions of source code must retain the above
> + *   copyright notice, this list of conditions and the
> + *   following disclaimer.
> + *
> + * - Redistributions in binary form must reproduce the above
> + *   copyright notice, this list of conditions and the
> + *   following disclaimer in the documentation and/or other
> + *   materials provided with the distribution.
> + *
> + * - Neither the name of Internet Society Society, IETF or IETF
> + *   Trust, nor the names of specific contributors, may be
> + *   used to endorse or promote products derived from this
> + *   software without specific prior written permission.
> + *
> + *   THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS
> + *   AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED
> + *   WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
> + *   IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
> + *   FOR A PARTICULAR PURPOSE ARE DISCLAIMED.  IN NO
> + *   EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE
> + *   LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
> + *   EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
> + *   NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
> + *   SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
> + *   INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
> + *   LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
> + *   OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING
> + *   IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF
> + *   ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
> +
> + */
> +
> +/*
> + * This code was derived from [draft-ietf-nfsv4-minorversion2-dot-x-38].
> + */
> +
>  /*
>   *  Copyright (C) The IETF Trust (2007-2014)
>   *  All Rights Reserved.
> @@ -667,9 +712,9 @@ typedef uint32_t        fs_charset_cap4;
>   */
>  
>  enum netloc_type4 {
> -        NL4_NAME        = 0,
> -        NL4_URL         = 1,
> -        NL4_NETADDR     = 2
> +        NL4_NAME        = 1,
> +        NL4_URL         = 2,
> +        NL4_NETADDR     = 3
>  };
>  union netloc4 switch (netloc_type4 nl_type) {
>          case NL4_NAME:          utf8str_cis nl_name;
> @@ -849,10 +894,11 @@ typedef change_policy4  fattr4_change_policy;
>  /*
>   * attributes new to NFSv4.2
>   */
> -typedef uint64_t        fattr_space_freed;
> +typedef uint64_t        fattr4_space_freed;
>  typedef change_attr_type4
>                  fattr4_change_attr_type;
> -typedef sec_label4      fattr_sec_label<>;
> +typedef sec_label4      fattr4_sec_label<>;
> +typedef uint32_t        fattr4_clone_blksize;
>  
>  %/*
>  % * REQUIRED Attributes
> @@ -931,10 +977,6 @@ const FATTR4_DIRENT_NOTIF_DELAY = 57;
>  const FATTR4_DACL               = 58;
>  const FATTR4_SACL               = 59;
>  const FATTR4_CHANGE_POLICY      = 60;
> -
> -%/*
> -% * new to NFSV4.2
> -% */
>  const FATTR4_FS_STATUS          = 61;
>  const FATTR4_FS_LAYOUT_TYPES    = 62;
>  const FATTR4_LAYOUT_HINT        = 63;
> @@ -950,7 +992,11 @@ const FATTR4_RETENTEVT_SET      = 72;
>  const FATTR4_RETENTION_HOLD     = 73;
>  const FATTR4_MODE_SET_MASKED    = 74;
>  const FATTR4_FS_CHARSET_CAP     = 76;
> -/* 77 is currently unused */
> +
> +%/*
> +% * new to NFSV4.2
> +% */
> +const FATTR4_CLONE_BLKSIZE      = 77;
>  const FATTR4_SPACE_FREED        = 78;
>  const FATTR4_CHANGE_ATTR_TYPE   = 79;
>  const FATTR4_SEC_LABEL          = 80;
> @@ -1287,6 +1333,7 @@ enum nfs_opnum4 {
>   OP_READ_PLUS           = 68,
>   OP_SEEK                = 69,
>   OP_WRITE_SAME          = 70,
> + OP_CLONE               = 71,
>   OP_ILLEGAL             = 10044
>  };
>  
> @@ -1316,6 +1363,19 @@ union ACCESS4res switch (nfsstat4 status) {
>          void;
>  };
>  
> +struct CLONE4args {
> +        /* SAVED_FH: source file */
> +        /* CURRENT_FH: destination file */
> +        stateid4        cl_src_stateid;
> +        stateid4        cl_dst_stateid;
> +        offset4         cl_src_offset;
> +        offset4         cl_dst_offset;
> +        length4         cl_count;
> +};
> +
> +struct CLONE4res {
> +        nfsstat4        cl_status;
> +};
>  struct CLOSE4args {
>          /* CURRENT_FH: object */
>          seqid4          seqid;
> @@ -2759,13 +2819,24 @@ struct COPY4args {
>  };
>  
>  
> -struct COPY4res {
> -        nfsstat4        cr_status;
> -        write_response4 cr_response;
> +struct copy_requirements4 {
>          bool            cr_consecutive;
>          bool            cr_synchronous;
>  };
>  
> +struct COPY4resok {
> +        write_response4         cr_response;
> +        copy_requirements4      cr_requirements;
> +};
> +
> +union COPY4res switch (nfsstat4 cr_status) {
> +case NFS4_OK:
> +        COPY4resok              cr_resok4;
> +case NFS4ERR_OFFLOAD_NO_REQS:
> +        copy_requirements4      cr_requirements;
> +default:
> +        void;
> +};
>  
>  struct COPY_NOTIFY4args {
>          /* CURRENT_FH: source file */
> @@ -2775,6 +2846,7 @@ struct COPY_NOTIFY4args {
>  
>  struct COPY_NOTIFY4resok {
>          nfstime4        cnr_lease_time;
> +        stateid4        cnr_stateid;
>          netloc4         cnr_source_server<>;
>  };
>  
> @@ -2887,7 +2959,7 @@ struct LAYOUTERROR4res {
>  };
>  
>  struct io_info4 {
> -        uint32_t        ii_count;
> +        uint64_t        ii_count;
>          uint64_t        ii_bytes;
>  };
>  
> @@ -3088,6 +3160,7 @@ union nfs_argop4 switch (nfs_opnum4 argop) {
>   case OP_READ_PLUS:     READ_PLUS4args opread_plus;
>   case OP_SEEK:          SEEK4args opseek;
>   case OP_WRITE_SAME:    WRITE_SAME4args opwrite_same;
> + case OP_CLONE:         CLONE4args opclone;
>  
>   /* Operations not new to NFSv4.1 */
>   case OP_ILLEGAL:       void;
> @@ -3216,6 +3289,7 @@ union nfs_resop4 switch (nfs_opnum4 resop) {
>   case OP_READ_PLUS:     READ_PLUS4res opread_plus;
>   case OP_SEEK:          SEEK4res opseek;
>   case OP_WRITE_SAME:    WRITE_SAME4res opwrite_same;
> + case OP_CLONE:         CLONE4res opclone;
>  
>   /* Operations not new to NFSv4.1 */
>   case OP_ILLEGAL:       ILLEGAL4res opillegal;
> -- 
> 2.4.3

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

end of thread, other threads:[~2015-08-18 19:27 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-07-28 11:46 [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4 Kinglong Mee
2015-07-29 19:37 ` J. Bruce Fields
2015-07-30 12:05   ` Kinglong Mee
2015-07-30 12:13     ` [PATCH v2] 4.1 xdrdef: Update nfs4.x to the latest dot-x-38.txt Kinglong Mee
2015-08-18 19:27       ` J. Bruce Fields
2015-07-30 14:22     ` [PATCH] NFSD: Encode security label as an array Kinglong Mee
2015-07-30 14:22     ` [PATCH] NFS: Decode " Kinglong Mee
2015-07-30 15:48     ` [PATCH 3/4] 4.1 xdrdef: Fix bad define of sec_label4 J. Bruce Fields

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.