NFSv4 D. Robinson Internet-Draft Sun Expires: January 14, 2006 July 13, 2005 NFSv4 current stateid draft-robinson-curstateid-00 Status of this Memo By submitting this Internet-Draft, each author represents that any applicable patent or other IPR claims of which he or she is aware have been or will be disclosed, and any of which he or she becomes aware will be disclosed, in accordance with Section 6 of BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF), its areas, and its working groups. Note that other groups may also distribute working documents as Internet- Drafts. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." The list of current Internet-Drafts can be accessed at http://www.ietf.org/ietf/1id-abstracts.txt. The list of Internet-Draft Shadow Directories can be accessed at http://www.ietf.org/shadow.html. This Internet-Draft will expire on January 14, 2006. Copyright Notice Copyright (C) The Internet Society (2005). Abstract The semantics of the NFSv4 server are changed to include tracking the value of current stateid in addition to the existing current filehandle. This will allow the stateid generated by one operation to be used by a subsequent operation without incurring an addition round trip operation. Robinson Expires January 14, 2006 [Page 1] Internet-Draft NFSv4 current stateid July 2005 1. Introduction The NFSv4 COMPOUND operation introduced the concept of a current filehandle to allow an operation that retrieve or creates a filehandle to pass its value to a subsequent operation. In addition it also created operations to allow the saving and restoring of the current file handle. This has the benefit of both simplifying the individual operations as well as removing unnecessary round trips just to communicate the previous result to the next operation. One deficiency in the NFSv4 COMPOUND model is that only the filehandle may be passed from one operation to another. While a complex scheme to pass any result as arguments to any other operation's arguments is possible to be constructed, the most notable state that cannot be passed is the stateid. During the initial creation of the NFSv4 protocol, it was imagined that COMPOUND could be used for optimizations such as opening, reading, and closing a file all in a single RPC. Without the ability to pass the stateid between operations this cannot be done without using a special stateid that may potentially circumvent file record locking. This proposal adds to the server's COMPOUND state a "current stateid" and a "saved stateid" which are passed between operations. There are no changes to the syntax of the protocol, only changes to the semantics of a few operations in a manner that is mostly compatible with the existing implementations. Robinson Expires January 14, 2006 [Page 2] Internet-Draft NFSv4 current stateid July 2005 2. Current Stateid A "current stateid" is the stateid that is associated with the current filehandle. This proposal introduces no new operations that independently manipulate the current stateid, it may only be retrieved or modified using existing operations. Any NFSv4 operation that modifies the current filehandle MUST also modify the current stateid. Those operations that also return a stateid MUST set the current stateid to that value. Those operations that do not return a stateid MUST set the current stateid to the special all-zeros stateid. As an example, PUTFH will change the current server state from {ocfh, osid} to {cfh, 0} while LOCK will change the current state from {cfh, osid} to {cfh, nsid}. The SAVEFH and RESTOREFH operations will save and restore both the filehandle and the stateid as a set. Any NFSv4 operation that takes as an argument a stateid that is not the special all-zeros stateid MUST set the current stateid to that value before evaluating the operation. If the argument is the special all-zeros stateid, the operation is evaluated using the current stateid. Examples of current stateid usage. PUTFH fh1 - -> {fh1, 0} READ sid1,0,1024 {fh1, sid1} -> {fh1, sid1} PUTFH fh1 - -> {fh1, 0} OPEN R,sid1,"foo" {fh1, sid1} -> {fh2, sid2} READ 0,0,1024 {fh2, sid2} -> {fh2, sid2} CLOSE 0 {fh2, sid2} -> {fh2, sid3} PUTFH fh1 - -> {fh1, 0} LOCK W,0,1024,sid1 {fh1, sid1} -> {fh1, sid2} READ 0,0,1024 {fh1, sid2} -> {fh1, sid2} LOCKU W,0,1024,0 {fh1, sid2} -> {fh1, sid3} Figure 1 In Figure 1 the first example is the common case of a simple READ operation with a supplied stateid showing that the PUTFH initializes the current stateid to zero. The subsequent READ with stateid sid1 replaces the current stateid before evaluating the operation. The second example performs an OPEN with the client provided stateid sid1 and as a result generates stateid sid2. The next operation specifies the READ with the special all-zero stateid but the current Robinson Expires January 14, 2006 [Page 3] Internet-Draft NFSv4 current stateid July 2005 stateid set by the previous operation is actually used when the operation is evaluated, allowing correct interaction with any existing, potentially conflicting, locks. The third example is similar to the second in how it passes the stateid sid2 generated by the LOCK operation to the next READ operation. This allows the client to explicitly surround a single I/O operation with a lock and its appropriate stateid to guarantee correctness with other client locks. Robinson Expires January 14, 2006 [Page 4] Internet-Draft NFSv4 current stateid July 2005 3. Discussion The current stateid is only used if the client has specified as an argument to an operation a special stateid that is all-zeros. Most current NFSv4 clients do not use the special stateids and as a result, will see no semantic difference when the current stateid is introduced. For those clients that do use the special stateid, most will be doing so in situations that the current stateid is designed to address, eliminating an extra round trip just to supply the stateid. Using the current stateid will almost always be semantically correct. There may be a rare case where the client's use of a special stateid is used with the intent of bypassing the actual state that client has established, but this is not expected to be significant. Robinson Expires January 14, 2006 [Page 5] Internet-Draft NFSv4 current stateid July 2005 4. IANA Considerations This document has no actions for IANA. 5. Normative References [1] Shepler, et al., S., "NFS Version 4 Protocol", RFC 3530, April 2003. Author's Address David Robinson Sun Microsystems, Inc. 5300 Riata Park Court UAUS08-102 Austin, TX 78727 US Phone: +1 512 401 1757 Email: David.Robinson@sun.com Robinson Expires January 14, 2006 [Page 6] Internet-Draft NFSv4 current stateid July 2005 Intellectual Property Statement The IETF takes no position regarding the validity or scope of any Intellectual Property Rights or other rights that might be claimed to pertain to the implementation or use of the technology described in this document or the extent to which any license under such rights might or might not be available; nor does it represent that it has made any independent effort to identify any such rights. Information on the procedures with respect to rights in RFC documents can be found in BCP 78 and BCP 79. Copies of IPR disclosures made to the IETF Secretariat and any assurances of licenses to be made available, or the result of an attempt made to obtain a general license or permission for the use of such proprietary rights by implementers or users of this specification can be obtained from the IETF on-line IPR repository at http://www.ietf.org/ipr. The IETF invites any interested party to bring to its attention any copyrights, patents or patent applications, or other proprietary rights that may cover technology that may be required to implement this standard. Please address the information to the IETF at ietf-ipr@ietf.org. Disclaimer of Validity This document and the information contained herein are provided on an "AS IS" basis and THE CONTRIBUTOR, THE ORGANIZATION HE/SHE REPRESENTS OR IS SPONSORED BY (IF ANY), THE INTERNET SOCIETY AND THE INTERNET ENGINEERING TASK FORCE DISCLAIM ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTY THAT THE USE OF THE INFORMATION HEREIN WILL NOT INFRINGE ANY RIGHTS OR ANY IMPLIED WARRANTIES OF MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE. Copyright Statement Copyright (C) The Internet Society (2005). This document is subject to the rights, licenses and restrictions contained in BCP 78, and except as set forth therein, the authors retain all their rights. Acknowledgment Funding for the RFC Editor function is currently provided by the Internet Society. Robinson Expires January 14, 2006 [Page 7]