Subject: [nfsv4] inconsistency in treatment of multiple filehandles referring to same object.

From: "J. Bruce Fields" <[email-masked]>
Date: Fri, 26 Oct 2012 09:36:58 -0400

Filehandles can point to the same objects, and clients can use that fact
for caching if they want to, but the open state is actually
per-filehandle.  Some of the language in 3530 gets this wrong.  It may
be too late to fix 3530 at this point, but here you go in case it's
useful.

5661 has the same problem.

commit 737cff4df4f8815fe939cf2e70f5c73a9178e42e
Author: J. Bruce Fields <[email-masked]>
Date:   Fri Oct 26 09:24:44 2012 -0400

    fix inconsistent filehandle-aliasing language
    
    Currently language in 4.2.1:
    
    	"Clients MUST use filehandle comparisons only to improve
    	performance, not for correct behavior."
    
    contradicts language in 8.11:
    
    	"When the server chooses to export multiple filehandles
    	corresponding to the same file object and returns different
    	filehandles on two different OPENs of the same file object, the
    	server MUST NOT "OR" together the access and deny bits and
    	coalesce the two open files.  Instead the server must maintain
    	separate OPENs with separate stateids and will require separate
    	CLOSEs to free them."
    
    I believe the more specific case in 8.11 takes precedence.
    
    In fact, the 4.1 language looks useless to me; remove it, and add some
    cross-references to help clarify the situation.

diff --git a/nfsv4_middle_client_cache.xml b/nfsv4_middle_client_cache.xml
index 1032887..c195934 100644
--- a/nfsv4_middle_client_cache.xml
+++ b/nfsv4_middle_client_cache.xml
@@ -742,6 +742,12 @@
         </list>
       </t>
 
+      <t>
+        Note that even when different filehandles refer to the same object,
+	they are still treated differently for the sake of open state; see
+	<xref target="ss:fl:oud" />
+      </t>
+
     </section>
   </section>
   <section anchor="ss:cc:open_dele" title="Open Delegation">
diff --git a/nfsv4_middle_filehandles.xml b/nfsv4_middle_filehandles.xml
index 07a2cdd..74ad4cf 100644
--- a/nfsv4_middle_filehandles.xml
+++ b/nfsv4_middle_filehandles.xml
@@ -120,13 +120,10 @@
         filehandles from the same server are equal, they MUST refer to
         the same file.  Servers SHOULD try to maintain a one-to-one
         correspondence between filehandles and files but this is not
-        required.  Clients MUST use filehandle comparisons only to improve
-        performance, not for correct behavior.  All clients need to be
-        prepared for situations in which it cannot be determined whether
-        two filehandles denote the same object and in such cases, avoid
-        making invalid assumptions which might cause incorrect behavior.
-        Further discussion of filehandle and attribute comparison in the
-        context of data caching is presented in <xref target="ss:cc:dcfi" />.
+        required.  Further discussion of filehandle and attribute comparison
+	in the context of data caching is presented in
+	<xref target="ss:cc:dcfi" />, and in the context of open state in
+	<xref target="ss:fl:oud" />.
       </t>
 
       <t>

---

From: "J. Bruce Fields" <[email-masked]>
Date: Fri, 26 Oct 2012 09:38:28 -0400

Sorry, this was meant to be sent to Tom, cc'd to [email-masked].  I'm
surprised my client will let me send without a "To:" address.  Anyway.

---

From: "J. Bruce Fields" <[email-masked]>
Date: Sun, 28 Oct 2012 09:52:57 -0400

Oops, I forgot to add the anchor that the new language points to.

--b.

commit 8795e36594d1622f93c347f1bed5d55fdb2df29f
Author: J. Bruce Fields <[email-masked]>
Date:   Fri Oct 26 09:24:44 2012 -0400

    

    

 
+      <t>
+        Note that even when different filehandles refer to the same object,
+	they are still treated differently for the sake of open state; see
+	<xref target="ss:fl:oud" />
+      </t>
+
     </section>
   </section>
   <section anchor="ss:cc:open_dele" title="Open Delegation">
diff --git a/nfsv4_middle_file_locking.xml b/nfsv4_middle_file_locking.xml
index 6a68b4d..c4ca58a 100644
--- a/nfsv4_middle_file_locking.xml
+++ b/nfsv4_middle_file_locking.xml
@@ -2253,7 +2253,7 @@
 
     </section>
   </section>
-  <section title="Open Upgrade and Downgrade">
+  <section anchor="ss:fl:oud" title="Open Upgrade and Downgrade">
 
     <t>
       When an OPEN is done for a file and the open-owner for which
 
       <t>