Subject: [nfsv4] new utf-8 attribute

From: Mike Eisler <[email-masked]>
Date: Fri, 14 Dec 2007 21:32:41 -0800 (PST)

Attached are the diffs for a new per-fsid attribute that
indicates:

1. whether the contains have non-utf-8 chars
2. whether the server requires utf-8 chars

Index: Makefile
===================================================================
RCS file: /cvs/stdk/NFSv41/Makefile,v
retrieving revision 1.100
diff -u -w -b -r1.100 Makefile
--- Makefile	10 Dec 2007 09:27:06 -0000	1.100
+++ Makefile	15 Dec 2007 05:29:37 -0000
@@ -140,6 +140,7 @@
 		dotx.d/type_acemask4.x \
 		dotx.d/type_nfsace4.x \
 		dotx.d/type_fs4_status.x \
+		dotx.d/type_fs_charset_cap4.x \
 		dotx.d/const_acetype4.x \
 		dotx.d/const_aceflag4.x \
 		dotx.d/const_aclsupport4.x \
@@ -203,6 +204,7 @@
 		autogen/type_acemask4.xml \
 		autogen/type_nfsace4.xml \
 		autogen/type_fs4_status.xml \
+		autogen/type_fs_charset_cap4.xml \
 		autogen/const_acetype4.xml \
 		autogen/const_aceflag4.xml \
 		autogen/const_aclsupport4.xml \
Index: nfsv41_middle_cbproc_compound.xml
===================================================================
RCS file: /cvs/stdk/NFSv41/nfsv41_middle_cbproc_compound.xml,v
retrieving revision 1.13
diff -u -w -b -r1.13 nfsv41_middle_cbproc_compound.xml
--- nfsv41_middle_cbproc_compound.xml	25 Nov 2007 00:35:58 -0000	1.13
+++ nfsv41_middle_cbproc_compound.xml	15 Dec 2007 05:29:37 -0000
@@ -82,7 +82,7 @@
 
      <c>NFS4ERR_DELAY</c> <c> </c>
 
-     <c>NFS4ERR_INVAL</c> <c>The tag argument is not in UTF8 encoding.</c>
+     <c>NFS4ERR_INVAL</c> <c>The tag argument is not in UTF-8 encoding.</c>
 
      <c>NFS4ERR_MINOR_VERS_MISMATCH</c> <c> </c>
 
Index: nfsv41_middle_fileattributes.xml
===================================================================
RCS file: /cvs/stdk/NFSv41/nfsv41_middle_fileattributes.xml,v
retrieving revision 1.33
diff -u -w -b -r1.33 nfsv41_middle_fileattributes.xml
--- nfsv41_middle_fileattributes.xml	14 Dec 2007 18:17:31 -0000	1.33
+++ nfsv41_middle_fileattributes.xml	15 Dec 2007 05:29:38 -0000
@@ -221,7 +221,7 @@
 	      maxname, maxread, maxwrite, no_trunc, space_avail,
 	      space_free, space_total, time_delta,
               change_policy, fs_status,
-	      fs_layout_type, fs_locations_info
+	      fs_layout_type, fs_locations_info, fscharset_cap
 	    </t>
 	  </list>
 	</t>    
@@ -415,6 +415,11 @@
 	<xref target="attrdef_files_total" />
       </c>
 
+      <c>fs_charset_cap</c><c>76</c><c>fs_charset_cap4</c><c>RD</c>
+      <c>
+	<xref target="attrdef_fs_charset_cap" />
+      </c>
+
       <c>fs_layout_type</c><c>62</c><c>layouttype4&lt;></c><c>RD</c>
       <c>
 	<xref target="attrdef_fs_layout_type" />
@@ -914,6 +919,14 @@
       </t>
     </section>
 
+    <section toc="exclude" anchor="attrdef_fs_charset_cap" 
+	     title="Attribute 76: fs_charset_cap">
+      <t>
+        Character set capabilities for this file system. See
+        <xref target="utf8_caps"/>.
+      </t>
+    </section>
+
     <section toc="exclude" anchor="attrdef_fs_locations"
 	     title="Attribute 24: fs_locations">
       <t>
Index: nfsv41_middle_i18n.xml
===================================================================
RCS file: /cvs/stdk/NFSv41/nfsv41_middle_i18n.xml,v
retrieving revision 1.11
diff -u -w -b -r1.11 nfsv41_middle_i18n.xml
--- nfsv41_middle_i18n.xml	20 Nov 2007 23:48:48 -0000	1.11
+++ nfsv41_middle_i18n.xml	15 Dec 2007 05:29:38 -0000
@@ -286,6 +286,27 @@
 </t>
 </section>
 </section>
+<section title="UTF-8 Capabilities" anchor="utf8_caps">
+<?rfc include='autogen/type_fs_charset_cap4.xml'?>
+<t>
+Because some operating environments and file systems do
+not enforce character set encodings, NFSv4.1 supports the
+fs_charset_cap option (<xref target="attrdef_fs_charset_cap"/>)
+that indicates to the client a file system's UTF-8 capabilities.
+The option is an integer containing a pair of flags.
+The first flag is FSCHARSET_CAP4_CONTAINS_NON_UTF8, which, if set
+to one tells the client the file system contains non-UTF-8 characters,
+and the server will not convert non-UTF characters to UTF-8 if the client
+reads a symlink or directory, nor will operations that take component
+names or pathname have the strings converted to UTF-8.
+The second flag is FSCHARSET_CAP4_ALLOWS_ONLY_UTF8 which if set to
+one, indicates that the server will accept (and generate) only
+UTF-8 characters on the file system. If 
+FSCHARSET_CAP4_ALLOWS_ONLY_UTF8 is set to one, 
+FSCHARSET_CAP4_CONTAINS_NON_UTF8 MUST be set to zero.
+FSCHARSET_CAP4_ALLOWS_ONLY_UTF8 SHOULD always be set to one.
+</t>
+</section>
 <section title="UTF-8 Related Errors" anchor="utf8_related_errors">
 <t>
 Where the client sends an invalid UTF-8 string, the server should
Index: nfsv41_middle_multi_server_ns.xml
===================================================================
RCS file: /cvs/stdk/NFSv41/nfsv41_middle_multi_server_ns.xml,v
retrieving revision 1.27
diff -u -w -b -r1.27 nfsv41_middle_multi_server_ns.xml
--- nfsv41_middle_multi_server_ns.xml	29 Nov 2007 15:50:21 -0000	1.27
+++ nfsv41_middle_multi_server_ns.xml	15 Dec 2007 05:29:39 -0000
@@ -1901,7 +1901,7 @@
       When a set of servers have corresponding file systems at the
       same path within their namespaces, an array of server names may 
       be provided.  An
-      entry in the server array is a UTF8 string and represents one 
+      entry in the server array is a UTF-8 string and represents one 
       of a
       traditional DNS host name, IPv4 address, or IPv6 address, or an
       zero-length string.  
Index: nfsv41_middle_op_create.xml
===================================================================
RCS file: /cvs/stdk/NFSv41/nfsv41_middle_op_create.xml,v
retrieving revision 1.8
diff -u -w -b -r1.8 nfsv41_middle_op_create.xml
--- nfsv41_middle_op_create.xml	14 Dec 2007 18:17:32 -0000	1.8
+++ nfsv41_middle_op_create.xml	15 Dec 2007 05:29:39 -0000
@@ -99,6 +99,12 @@
       request such notifications, NOTIFY4_ADD_ENTRY will be generated
       as a result of this operation.
     </t>
+    <t>
+      If the capability FSCHARSET_CAP4_ALLOWS_ONLY_UTF8 is set
+      (<xref target="utf8_caps"/>),
+      and a symbolic link is being created, then the content
+      of the symbolic link MUST be in UTF-8 encoding.
+    </t>
   </section>
   <section toc="exclude" anchor="OP_CREATE_IMPLEMENTATION" title="IMPLEMENTATION">
     <t>
Index: nfsv41_middle_proc_compound.xml
===================================================================
RCS file: /cvs/stdk/NFSv41/nfsv41_middle_proc_compound.xml,v
retrieving revision 1.13
diff -u -w -b -r1.13 nfsv41_middle_proc_compound.xml
--- nfsv41_middle_proc_compound.xml	25 Nov 2007 00:35:58 -0000	1.13
+++ nfsv41_middle_proc_compound.xml	15 Dec 2007 05:29:39 -0000
@@ -255,7 +255,7 @@
 
      <c>NFS4ERR_DELAY</c> <c> </c>
 
-     <c>NFS4ERR_INVAL</c> <c>The tag argument is not in UTF8 encoding.</c>
+     <c>NFS4ERR_INVAL</c> <c>The tag argument is not in UTF-8 encoding.</c>
 
      <c>NFS4ERR_MINOR_VERS_MISMATCH</c> <c> </c>
 
Index: dotx.d/Makefile
===================================================================
RCS file: /cvs/stdk/NFSv41/dotx.d/Makefile,v
retrieving revision 1.40
diff -u -w -b -r1.40 Makefile
--- dotx.d/Makefile	10 Dec 2007 09:27:14 -0000	1.40
+++ dotx.d/Makefile	15 Dec 2007 05:29:39 -0000
@@ -179,6 +179,7 @@
 		type_acemask4.x \
 		type_nfsace4.x \
 		type_fs4_status.x \
+		type_fs_charset_cap4.x \
 		const_acetype4.x \
 		const_aceflag4.x \
 		const_aclsupport4.x \
Index: dotx.d/head.x
===================================================================
RCS file: /cvs/stdk/NFSv41/dotx.d/head.x,v
retrieving revision 1.51
diff -u -w -b -r1.51 head.x
--- dotx.d/head.x	15 Dec 2007 03:47:56 -0000	1.51
+++ dotx.d/head.x	15 Dec 2007 05:29:39 -0000
@@ -379,6 +379,7 @@
 include(type_mdsthreshold4.x)
 include(type_retention_get4.x)
 include(type_retention_set4.x)
+include(type_fs_charset_cap4.x)
 
 /*
  * NFSv4.1 attributes
@@ -449,6 +450,7 @@
 typedef bool		fattr4_absent;
 typedef layouttype4	fattr4_fs_layout_types<>;
 typedef fs4_status	fattr4_fs_status;
+typedef fs_charset_cap4	fattr4_fs_charset_cap4;
 typedef uint32_t	fattr4_layout_alignment;
 typedef uint32_t	fattr4_layout_blksize;
 typedef layouthint4	fattr4_layout_hint;
@@ -546,6 +548,7 @@
 const FATTR4_RETENTEVT_SET	= 72;
 const FATTR4_RETENTION_HOLD	= 73;
 const FATTR4_MODE_SET_MASKED	= 74;
+const FATTR4_FS_CHARSET_CAP	= 76;
 
 /*
  * File attribute container
Index: dotx.d/spit_types.sh
===================================================================
RCS file: /cvs/stdk/NFSv41/dotx.d/spit_types.sh,v
retrieving revision 1.38
diff -u -w -b -r1.38 spit_types.sh
--- dotx.d/spit_types.sh	10 Dec 2007 09:27:14 -0000	1.38
+++ dotx.d/spit_types.sh	15 Dec 2007 05:29:39 -0000
@@ -633,6 +633,17 @@
 EOF
 	;;
 
+	type_fs_charset_cap4.x )
+
+cat << EOF > $i
+const FSCHARSET_CAP4_CONTAINS_NON_UTF8	= 0x1;
+const FSCHARSET_CAP4_ALLOWS_ONLY_UTF8	= 0x2;
+
+typedef uint32_t	fs_charset_cap4;
+EOF
+	;;
+
+
 	const_acetype4.x )
 
 cat << EOF > $i
_______________________________________________
nfsv4 mailing list
[email-masked]
https://www1.ietf.org/mailman/listinfo/nfsv4