draft-ietf-nfsv4-rfc3010bis-00.txt  -->   draft-ietf-nfsv4-rfc3010bis-02.txt

view Side-By-Side changes






NFS Version version 4 Working Group                                  S. Shepler
INTERNET-DRAFT                                   Sun Microsystems, Inc.
Document: draft-ietf-nfsv4-rfc3010bis-00.txt draft-ietf-nfsv4-rfc3010bis-02.txt                   C. Beame
                                                       Hummingbird Ltd.
                                                           B. Callaghan
                                                 Sun Microsystems, Inc.
                                                              M. Eisler
                                                          Zambeel,
                                                Network Appliance, Inc.
                                                              D. Noveck
                                                Network Appliance, Inc.
                                                            D. Robinson
                                                 Sun Microsystems, Inc.
                                                             R. Thurlow
                                                 Sun Microsystems, Inc.
                                                          November 2001
                                                            August 2002



                         NFS version 4 Protocol



Status of this Memo

   This document is an Internet-Draft and is in full conformance with
   all provisions of Section 10 of RFC2026.

   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.


Abstract

   NFS version 4 is a distributed file system filesystem protocol which owes
   heritage to NFS protocol versions 2 [RFC1094] and 3 [RFC1813].



Expires: May 2002 February 2003                                          [Page 1]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


   Unlike earlier versions, the NFS version 4 protocol supports
   traditional file access while integrating support for file locking
   and the mount protocol.  In addition, support for strong security
   (and its negotiation), compound operations, client caching, and
   internationalization have been added.  Of course, attention has been
   applied to making NFS version 4 operate well in an Internet
   environment.


Copyright

   Copyright (C) The Internet Society (2001). (2000-2002).  All Rights Reserved.


Key Words

   The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
   "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
   document are to be interpreted as described in RFC 2119. [RFC2119].
































Expires: May 2002 February 2003                                          [Page 2]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


Table of Contents

   1.  Introduction . . . . . . . . . . . . . . . . . . . . . . . . 7
   1.1.  Inconsistencies of this Document with Section 18 . . . . . 7
   1.2.  Overview of NFS Version version 4 Features . . . . . . . . . . . . 7
   1.1.1. 8
   1.2.1.  RPC and Security . . . . . . . . . . . . . . . . . . . . 8
   1.1.2.
   1.2.2.  Procedure and Operation Structure  . . . . . . . . . . . 8
   1.1.3.  File System
   1.2.3.  Filesystem Model . . . . . . . . . . . . . . . . . . . . 9
   1.1.3.1.
   1.2.3.1.  Filehandle Types . . . . . . . . . . . . . . . . . . . 9
   1.1.3.2.
   1.2.3.2.  Attribute Types  . . . . . . . . . . . . . . . . . . . 9
   1.1.3.3.  File System  10
   1.2.3.3.  Filesystem Replication and Migration . . . . . . . .  10
   1.1.4.
   1.2.4.  OPEN and CLOSE . . . . . . . . . . . . . . . . . . . .  10
   1.1.5.  11
   1.2.5.  File locking . . . . . . . . . . . . . . . . . . . . .  10
   1.1.6.  11
   1.2.6.  Client Caching and Delegation  . . . . . . . . . . . .  11
   1.2.
   1.3.  General Definitions  . . . . . . . . . . . . . . . . . .  12
   2.  Protocol Data Types  . . . . . . . . . . . . . . . . . . .  14
   2.1.  Basic Data Types . . . . . . . . . . . . . . . . . . . .  14
   2.2.  Structured Data Types  . . . . . . . . . . . . . . . . .  15
   3.  RPC and Security Flavor  . . . . . . . . . . . . . . . . .  20  21
   3.1.  Ports and Transports . . . . . . . . . . . . . . . . . .  20  21
   3.1.1.  Client Retransmission Behavior . . . . . . . . . . . .  21
   3.2.  Security Flavors . . . . . . . . . . . . . . . . . . . .  20  22
   3.2.1.  Security mechanisms for NFS version 4  . . . . . . . .  20  22
   3.2.1.1.  Kerberos V5 as a security triple . . . . . . . . . . .  21  22
   3.2.1.2.  LIPKEY as a security triple  . . . . . . . . . . . .  21  23
   3.2.1.3.  SPKM-3 as a security triple  . . . . . . . . . . . .  22  24
   3.3.  Security Negotiation . . . . . . . . . . . . . . . . . .  23  24
   3.3.1.  Security Error  SECINFO  . . . . . . . . . . . . . . . . . . . .  23
   3.3.2.  SECINFO . . .  25
   3.3.2.  Security Error . . . . . . . . . . . . . . . . . . . .  23  25
   3.4.  Callback RPC Authentication  . . . . . . . . . . . . . .  23  25
   4.  Filehandles  . . . . . . . . . . . . . . . . . . . . . . .  26  28
   4.1.  Obtaining the First Filehandle . . . . . . . . . . . . .  26  28
   4.1.1.  Root Filehandle  . . . . . . . . . . . . . . . . . . .  26  28
   4.1.2.  Public Filehandle  . . . . . . . . . . . . . . . . . .  27  28
   4.2.  Filehandle Types . . . . . . . . . . . . . . . . . . . .  27  29
   4.2.1.  General Properties of a Filehandle . . . . . . . . . .  27  29
   4.2.2.  Persistent Filehandle  . . . . . . . . . . . . . . . .  28  30
   4.2.3.  Volatile Filehandle  . . . . . . . . . . . . . . . . .  28  30
   4.2.4.  One Method of Constructing a Volatile Filehandle . . .  30  31
   4.3.  Client Recovery from Filehandle Expiration . . . . . . .  30  32
   5.  File Attributes  . . . . . . . . . . . . . . . . . . . . .  32  34
   5.1.  Mandatory Attributes . . . . . . . . . . . . . . . . . .  33  35
   5.2.  Recommended Attributes . . . . . . . . . . . . . . . . .  33  35
   5.3.  Named Attributes . . . . . . . . . . . . . . . . . . . .  33  35
   5.4.  Classification of Attributes . . . . . . . . . . . . . .  36
   5.5.  Mandatory Attributes - Definitions . . . . . . . . . . .  35
   5.5.  38
   5.6.  Recommended Attributes - Definitions . . . . . . . . . .  37
   5.6.  40
   5.7.  Time Access  . . . . . . . . . . . . . . . . . . . . . .  45
   5.8.  Interpreting owner and owner_group . . . . . . . . . . .  41
   5.7.  45
   5.9.  Character Case Attributes  . . . . . . . . . . . . . . .  42
   5.8.  47
   5.10.  Quota Attributes  . . . . . . . . . . . . . . . . . . . .  42
   5.9.  47
   5.11.  Access Control Lists  . . . . . . . . . . . . . . . . . .  43
   5.9.1.  48


Expires: February 2003                                          [Page 3]

Draft Specification      NFS version 4 Protocol              August 2002


   5.11.1.  ACE type  . . . . . . . . . . . . . . . . . . . . . .  49
   5.11.2.  ACE Access Mask . . . .  44
   5.9.2. . . . . . . . . . . . . . . .  50
   5.11.3.  ACE flag  . . . . . . . . . . . . . . . . . . . . . . .  44
   5.9.3.  52
   5.11.4.  ACE Access Mask who . . . . . . . . . . . . . . . . . . .  46
   5.9.4.  ACE who . . . .  53
   5.11.5.  Mode Attribute  . . . . . . . . . . . . . . . . . . .  47


Expires: May 2002                                               [Page 3]

Draft Specification      NFS version 4 Protocol            November 2001  54
   5.11.6.  Mode and ACL Attribute  . . . . . . . . . . . . . . .  55
   5.11.7.  mounted_on_fileid . . . . . . . . . . . . . . . . . .  55
   6.  File System  Filesystem Migration and Replication . . . . . . . . . .  48 .  57
   6.1.  Replication  . . . . . . . . . . . . . . . . . . . . . .  48  57
   6.2.  Migration  . . . . . . . . . . . . . . . . . . . . . . .  48  57
   6.3.  Interpretation of the fs_locations Attribute . . . . . .  49  58
   6.4.  Filehandle Recovery for Migration or Replication . . . .  50  59
   7.  NFS Server Name Space  . . . . . . . . . . . . . . . . . .  51  60
   7.1.  Server Exports . . . . . . . . . . . . . . . . . . . . .  51  60
   7.2.  Browsing Exports . . . . . . . . . . . . . . . . . . . .  51  60
   7.3.  Server Pseudo File System Filesystem . . . . . . . . . . . . . . .  51 .  60
   7.4.  Multiple Roots . . . . . . . . . . . . . . . . . . . . .  52  61
   7.5.  Filehandle Volatility  . . . . . . . . . . . . . . . . .  52  61
   7.6.  Exported Root  . . . . . . . . . . . . . . . . . . . . .  52  61
   7.7.  Mount Point Crossing . . . . . . . . . . . . . . . . . .  53  62
   7.8.  Security Policy and Name Space Presentation  . . . . . .  53  62
   8.  File Locking and Share Reservations  . . . . . . . . . . .  54  64
   8.1.  Locking  . . . . . . . . . . . . . . . . . . . . . . . .  54  64
   8.1.1.  Client ID  . . . . . . . . . . . . . . . . . . . . . .  54  64
   8.1.2.  Server Release of Clientid . . . . . . . . . . . . . .  56  67
   8.1.3.  nfs_lockowner  lock_owner and stateid Definition  . . . . . . . . .  57 .  68
   8.1.4.  Use of the stateid and Locking . . . . . . . . . . . . . . . . . .  58  69
   8.1.5.  Sequencing of Lock Requests  . . . . . . . . . . . . .  58  71
   8.1.6.  Recovery from Replayed Requests  . . . . . . . . . . .  59  72
   8.1.7.  Releasing nfs_lockowner lock_owner State . . . . . . . . . . . .  59 . .  72
   8.1.8.  Use of Open Confirmation . . . . . . . . . . . . . . .  73
   8.2.  Lock Ranges  . . . . . . . . . . . . . . . . . . . . . .  60  74
   8.3.  Upgrading and Downgrading Locks  . . . . . . . . . . . .  74
   8.4.  Blocking Locks . . . . . . . . . . . . . . . . . . . . .  61
   8.4.  75
   8.5.  Lease Renewal  . . . . . . . . . . . . . . . . . . . . .  61
   8.5.  75
   8.6.  Crash Recovery . . . . . . . . . . . . . . . . . . . . .  62
   8.5.1.  76
   8.6.1.  Client Failure and Recovery  . . . . . . . . . . . . .  62
   8.5.2.  76
   8.6.2.  Server Failure and Recovery  . . . . . . . . . . . . .  63
   8.5.3.  77
   8.6.3.  Network Partitions and Recovery  . . . . . . . . . . .  64
   8.6.  79
   8.7.  Recovery from a Lock Request Timeout or Abort  . . . . .  65
   8.7.  80
   8.8.  Server Revocation of Locks . . . . . . . . . . . . . . .  66
   8.8.  80
   8.9.  Share Reservations . . . . . . . . . . . . . . . . . . .  67
   8.9.  81
   8.10.  OPEN/CLOSE Operations . . . . . . . . . . . . . . . . .  68
   8.10.  82
   8.10.1.  Close and Retention of State Information  . . . . . .  83
   8.11.  Open Upgrade and Downgrade  . . . . . . . . . . . . . .  68
   8.11.  83
   8.12.  Short and Long Leases . . . . . . . . . . . . . . . . .  69
   8.12.  Clocks  84
   8.13.  Clocks, Propagation Delay, and Calculating Lease
          Expiration  . . . . . . . .  69
   8.13. . . . . . . . . . . . . . .  84
   8.14.  Migration, Replication and State  . . . . . . . . . . .  70
   8.13.1.  85
   8.14.1.  Migration and State . . . . . . . . . . . . . . . . .  70
   8.13.2.  85
   8.14.2.  Replication and State . . . . . . . . . . . . . . . .  70
   8.13.3.  86
   8.14.3.  Notification of Migrated Lease  . . . . . . . . . . .  71  86


Expires: February 2003                                          [Page 4]

Draft Specification      NFS version 4 Protocol              August 2002


   8.14.4.  Migration and the Lease_time Attribute  . . . . . . .  87
   9.  Client-Side Caching  . . . . . . . . . . . . . . . . . . .  72  88
   9.1.  Performance Challenges for Client-Side Caching . . . . .  72  88
   9.2.  Delegation and Callbacks . . . . . . . . . . . . . . . .  73  89
   9.2.1.  Delegation Recovery  . . . . . . . . . . . . . . . . .  74  90
   9.3.  Data Caching . . . . . . . . . . . . . . . . . . . . . .  76  92
   9.3.1.  Data Caching and OPENs . . . . . . . . . . . . . . . .  76  92
   9.3.2.  Data Caching and File Locking  . . . . . . . . . . . .  77  93
   9.3.3.  Data Caching and Mandatory File Locking  . . . . . . .  78  95
   9.3.4.  Data Caching and File Identity . . . . . . . . . . . .  79  95
   9.4.  Open Delegation  . . . . . . . . . . . . . . . . . . . .  80  96
   9.4.1.  Open Delegation and Data Caching . . . . . . . . . . .  82


Expires: May 2002                                               [Page 4]

Draft Specification      NFS version 4 Protocol            November 2001  99
   9.4.2.  Open Delegation and File Locks . . . . . . . . . . . .  83  100
   9.4.3.  Handling of CB_GETATTR . . . . . . . . . . . . . . . .  100
   9.4.4.  Recall of Open Delegation  . . . . . . . . . . . . . .  83
   9.4.4.  102
   9.4.5.  Delegation Revocation  . . . . . . . . . . . . . . . .  85  104
   9.5.  Data Caching and Revocation  . . . . . . . . . . . . . .  85  104
   9.5.1.  Revocation Recovery for Write Open Delegation  . . . .  86  104
   9.6.  Attribute Caching  . . . . . . . . . . . . . . . . . . .  87  105
   9.7.  Name Caching . . . . . . . . . . . . . . . . . . . . . .  88  107
   9.8.  Directory Caching  . . . . . . . . . . . . . . . . . . .  89  108
   10.  Minor Versioning  . . . . . . . . . . . . . . . . . . . .  91  110
   11.  Internationalization  . . . . . . . . . . . . . . . . . .  94  113
   11.1.  Universal Versus Local Character Sets . . . . . . . . .  94  113
   11.2.  Overview of Universal Character Set Standards . . . . .  95  114
   11.3.  Difficulties with UCS-4, UCS-2, Unicode . . . . . . . .  96  115
   11.4.  UTF-8 and its solutions . . . . . . . . . . . . . . . .  96  115
   11.5.  Normalization . . . . . . . . . . . . . . . . . . . . .  97  116
   11.6.  UTF-8 Related Errors  . . . . . . . . . . . . . . . . .  116
   12.  Error Definitions . . . . . . . . . . . . . . . . . . . .  98  118
   13.  NFS Version version 4 Requests  . . . . . . . . . . . . . . . . .  103  124
   13.1.  Compound Procedure  . . . . . . . . . . . . . . . . . .  103  124
   13.2.  Evaluation of a Compound Request  . . . . . . . . . . .  103  125
   13.3.  Synchronous Modifying Operations  . . . . . . . . . . .  104  125
   13.4.  Operation Values  . . . . . . . . . . . . . . . . . . .  105  126
   14.  NFS Version version 4 Procedures  . . . . . . . . . . . . . . . .  106  127
   14.1.  Procedure 0: NULL - No Operation  . . . . . . . . . . .  106  127
   14.2.  Procedure 1: COMPOUND - Compound Operations . . . . . .  107  128
   14.2.1.  Operation 3: ACCESS - Check Access Rights . . . . . .  110  131
   14.2.2.  Operation 4: CLOSE - Close File . . . . . . . . . . .  113  134
   14.2.3.  Operation 5: COMMIT - Commit Cached Data  . . . . . .  115  136
   14.2.4.  Operation 6: CREATE - Create a Non-Regular File Object 118 139
   14.2.5.  Operation 7: DELEGPURGE - Purge Delegations Awaiting
            Recovery  . . . . . . . . . . . . . . . . . . . . . .  120  142
   14.2.6.  Operation 8: DELEGRETURN - Return Delegation  . . . .  121  143
   14.2.7.  Operation 9: GETATTR - Get Attributes . . . . . . . .  122  144
   14.2.8.  Operation 10: GETFH - Get Current Filehandle  . . . .  124  146
   14.2.9.  Operation 11: LINK - Create Link to a File  . . . . .  126  148
   14.2.10.  Operation 12: LOCK - Create Lock . . . . . . . . . .  128  150
   14.2.11.  Operation 13: LOCKT - Test For Lock  . . . . . . . .  130  154
   14.2.12.  Operation 14: LOCKU - Unlock File  . . . . . . . . .  132  156
   14.2.13.  Operation 15: LOOKUP - Lookup Filename . . . . . . .  134  158


Expires: February 2003                                          [Page 5]

Draft Specification      NFS version 4 Protocol              August 2002


   14.2.14.  Operation 16: LOOKUPP - Lookup Parent Directory  . .  137  161
   14.2.15.  Operation 17: NVERIFY - Verify Difference in
             Attributes . . . . . . . . . . . . . . . . . . . . .  139  162
   14.2.16.  Operation 18: OPEN - Open a Regular File . . . . . .  141  164
   14.2.17.  Operation 19: OPENATTR - Open Named Attribute
             Directory  . . . . . . . . . . . . . . . . . . . . .  150  174
   14.2.18.  Operation 20: OPEN_CONFIRM - Confirm Open  . . . . .  152  176
   14.2.19.  Operation 21: OPEN_DOWNGRADE - Reduce Open File Access155 Access179
   14.2.20.  Operation 22: PUTFH - Set Current Filehandle . . . .  157  181
   14.2.21.  Operation 23: PUTPUBFH - Set Public Filehandle . . .  158  182
   14.2.22.  Operation 24: PUTROOTFH - Set Root Filehandle  . . .  159  184
   14.2.23.  Operation 25: READ - Read from File  . . . . . . . .  160  185
   14.2.24.  Operation 26: READDIR - Read Directory . . . . . . .  163  188
   14.2.25.  Operation 27: READLINK - Read Symbolic Link  . . . .  167


Expires: May 2002                                               [Page 5]

Draft Specification      NFS version 4 Protocol            November 2001  192
   14.2.26.  Operation 28: REMOVE - Remove Filesystem Object  . .  169  194
   14.2.27.  Operation 29: RENAME - Rename Directory Entry  . . .  171  197
   14.2.28.  Operation 30: RENEW - Renew a Lease  . . . . . . . .  174  200
   14.2.29.  Operation 31: RESTOREFH - Restore Saved Filehandle .  175  201
   14.2.30.  Operation 32: SAVEFH - Save Current Filehandle . . .  177  203
   14.2.31.  Operation 33: SECINFO - Obtain Available Security  .  178  204
   14.2.32.  Operation 34: SETATTR - Set Attributes . . . . . . .  180  208
   14.2.33.  Operation 35: SETCLIENTID - Negotiate Clientid . . .  182  211
   14.2.34.  Operation 36: SETCLIENTID_CONFIRM - Confirm Clientid  184  215
   14.2.35.  Operation 37: VERIFY - Verify Same Attributes  . . .  185  219
   14.2.36.  Operation 38: WRITE - Write to File  . . . . . . . .  187  221
   14.2.37.  Operation 39: RELEASE_LOCKOWNER - Release Lockowner
             State  . . . . . . . . . . . . . . . . . . . . . . .  226
   14.2.38.  Operation 10044: ILLEGAL - Illegal operation . . . .  228
   15.  NFS Version version 4 Callback Procedures . . . . . . . . . . . .  191  229
   15.1.  Procedure 0: CB_NULL - No Operation . . . . . . . . . .  191  229
   15.2.  Procedure 1: CB_COMPOUND - Compound Operations  . . . .  192  230
   15.2.1.  Operation 3: CB_GETATTR - Get Attributes  . . . . . .  194  232
   15.2.2.  Operation 4: CB_RECALL - Recall an Open Delegation  .  195  234
   15.2.3.  Operation 10044: CB_ILLEGAL - Illegal Callback
            Operation . . . . . . . . . . . . . . . . . . . . . .  236
   16.  Security Considerations . . . . . . . . . . . . . . . . .  197  237
   17.  IANA Considerations . . . . . . . . . . . . . . . . . . .  198  238
   17.1.  Named Attribute Definition  . . . . . . . . . . . . . .  198  238
   17.2.  ONC RPC Network Identifiers (netids)  . . . . . . . . .  238
   18.  RPC definition file . . . . . . . . . . . . . . . . . . .  199  239
   19.  Bibliography  . . . . . . . . . . . . . . . . . . . . . .  229  271
   20.  Authors . . . . . . . . . . . . . . . . . . . . . . . . .  234  277
   20.1.  Editor's Address  . . . . . . . . . . . . . . . . . . .  234  277
   20.2.  Authors' Addresses  . . . . . . . . . . . . . . . . . .  234  277
   20.3.  Acknowledgements  . . . . . . . . . . . . . . . . . . .  235  278
   21.  Full Copyright Statement  . . . . . . . . . . . . . . . .  236  279








Expires: May 2002 February 2003                                          [Page 6]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


1.  Introduction

   The NFS version 4 protocol is a further revision of the NFS protocol
   defined already by versions 2 [RFC1094] and 3 [RFC1813].  It retains
   the essential characteristics of previous versions: design for easy
   recovery, independent of transport protocols, operating systems and
   filesystems, simplicity, and good performance.  The NFS version 4
   revision has the following goals:


   o    Improved access and good performance on the Internet.

        The protocol is designed to transit firewalls easily, perform
        well where latency is high and bandwidth is low, and scale to
        very large numbers of clients per server.


   o    Strong security with negotiation built into the protocol.

        The protocol builds on the work of the ONCRPC working group in
        supporting the RPCSEC_GSS protocol.  Additionally, the NFS
        version 4 protocol provides a mechanism to allow clients and
        servers the ability to negotiate security and require clients
        and servers to support a minimal set of security schemes.


   o    Good cross-platform interoperability.

        The protocol features a file system filesystem model that provides a useful,
        common set of features that does not unduly favor one
        file system filesystem
        or operating system over another.


   o    Designed for protocol extensions.

        The protocol is designed to accept standard extensions that do
        not compromise backward compatibility.


1.1.  Inconsistencies of this Document with Section 18

   Section 18, RPC Definition File, contains the definitions in XDR
   description language of the constructs used by the protocol.  Prior
   to Section 18, several of the constructs are reproduced for purposes
   of explanation.  The reader is warned of the possibility of errors in
   the reproduced constructs outside of Section 18.  For any part of the
   document that is inconsistent with Section 18, Section 18 is to be
   considered authoritative.






Expires: February 2003                                          [Page 7]

Draft Specification      NFS version 4 Protocol              August 2002


1.2.  Overview of NFS Version version 4 Features

   To provide a reasonable context for the reader, the major features of
   NFS version 4 protocol will be reviewed in brief.  This will be done
   to provide an appropriate context for both the reader who is familiar
   with the previous versions of the NFS protocol and the reader that is
   new to the NFS protocols.  For the reader new to the NFS protocols,
   there is still a fundamental knowledge that is expected.  The reader
   should be familiar with the XDR and RPC protocols as described in
   [RFC1831] and [RFC1832].  A basic knowledge of file systems filesystems and
   distributed file systems filesystems is expected as well.




Expires: May 2002                                               [Page 7]

Draft Specification      NFS version 4 Protocol            November 2001


1.1.1.


1.2.1.  RPC and Security

   As with previous versions of NFS, the External Data Representation
   (XDR) and Remote Procedure Call (RPC) mechanisms used for the NFS
   version 4 protocol are those defined in [RFC1831] and [RFC1832].  To
   meet end to end security requirements, the RPCSEC_GSS framework
   [RFC2203] will be used to extend the basic RPC security.  With the
   use of RPCSEC_GSS, various mechanisms can be provided to offer
   authentication, integrity, and privacy to the NFS version 4 protocol.
   Kerberos V5 will be used as described in [RFC1964] to provide one
   security framework.  The LIPKEY GSS-API mechanism described in
   [RFC2847] will be used to provide for the use of user password and
   server public key by the NFS version 4 protocol.  With the use of
   RPCSEC_GSS, other mechanisms may also be specified and used for NFS
   version 4 security.

   To enable in-band security negotiation, the NFS version 4 protocol
   has added a new operation which provides the client a method of
   querying the server about its policies regarding which security
   mechanisms must be used for access to the server's file system filesystem
   resources.  With this, the client can securely match the security
   mechanism that meets the policies specified at both the client and
   server.


1.1.2.


1.2.2.  Procedure and Operation Structure

   A significant departure from the previous versions of the NFS
   protocol is the introduction of the COMPOUND procedure.  For the NFS
   version 4 protocol, there are two RPC procedures, NULL and COMPOUND.
   The COMPOUND procedure is defined in terms of operations and these
   operations correspond more closely to the traditional NFS procedures.
   With the use of the COMPOUND procedure, the client is able to build
   simple or complex requests.  These COMPOUND requests allow for a
   reduction in the number of RPCs needed for logical file system filesystem
   operations.  For example, without previous contact with a server a
   client will be able to read data from a file in one request by
   combining LOOKUP, OPEN, and READ operations in a single COMPOUND RPC.
   With previous versions of the NFS protocol, this type of single


Expires: February 2003                                          [Page 8]

Draft Specification      NFS version 4 Protocol              August 2002


   request was not possible.

   The model used for COMPOUND is very simple.  There is no logical OR
   or ANDing of operations.  The operations combined within a COMPOUND
   request are evaluated in order by the server.  Once an operation
   returns a failing result, the evaluation ends and the results of all
   evaluated operations are returned to the client.

   The NFS version 4 protocol continues to have the client refer to a
   file or directory at the server by a "filehandle".  The COMPOUND
   procedure has a method of passing a filehandle from one operation to
   another within the sequence of operations.  There is a concept of a
   "current filehandle" and "saved filehandle".  Most operations use the


Expires: May 2002                                               [Page 8]

Draft Specification      NFS version 4 Protocol            November 2001
   "current filehandle" as the file system filesystem object to operate upon.  The
   "saved filehandle" is used as temporary filehandle storage within a
   COMPOUND procedure as well as an additional operand for certain
   operations.


1.1.3.  File System


1.2.3.  Filesystem Model

   The general file system filesystem model used for the NFS version 4 protocol is
   the same as previous versions.  The server file system filesystem is hierarchical
   with the regular files contained within being treated as opaque byte
   streams.  In a slight departure, file and directory names are encoded
   with UTF-8 to deal with the basics of internationalization.

   The NFS version 4 protocol does not require a separate protocol to
   provide for the initial mapping between path name and filehandle.
   Instead of using the older MOUNT protocol for this mapping, the
   server provides a ROOT filehandle that represents the logical root or
   top of the file system filesystem tree provided by the server.  The server
   provides multiple file systems filesystems by glueing them together with pseudo
   file systems.
   filesystems.  These pseudo file systems filesystems provide for potential gaps in
   the path names between real file systems.


1.1.3.1. filesystems.


1.2.3.1.  Filehandle Types

   In previous versions of the NFS protocol, the filehandle provided by
   the server was guaranteed to be valid or persistent for the lifetime
   of the file system filesystem object to which it referred.  For some server
   implementations, this persistence requirement has been difficult to
   meet.  For the NFS version 4 protocol, this requirement has been
   relaxed by introducing another type of filehandle, volatile.  With
   persistent and volatile filehandle types, the server implementation
   can match the abilities of the file system filesystem at the server along with
   the operating environment.  The client will have knowledge of the
   type of filehandle being provided by the server and can be prepared
   to deal with the semantics of each.


1.1.3.2.




Expires: February 2003                                          [Page 9]

Draft Specification      NFS version 4 Protocol              August 2002


1.2.3.2.  Attribute Types

   The NFS version 4 protocol introduces three classes of file system filesystem or
   file attributes.  Like the additional filehandle type, the
   classification of file attributes has been done to ease server
   implementations along with extending the overall functionality of the
   NFS protocol.  This attribute model is structured to be extensible
   such that new attributes can be introduced in minor revisions of the
   protocol without requiring significant rework.

   The three classifications are: mandatory, recommended and named
   attributes.  This is a significant departure from the previous


Expires: May 2002                                               [Page 9]

Draft Specification      NFS version 4 Protocol            November 2001
   attribute model used in the NFS protocol.  Previously, the attributes
   for the file system filesystem and file objects were a fixed set of mainly Unix UNIX
   attributes.  If the server or client did not support a particular
   attribute, it would have to simulate the attribute the best it could.

   Mandatory attributes are the minimal set of file or file system filesystem
   attributes that must be provided by the server and must be properly
   represented by the server.  Recommended attributes represent
   different file system filesystem types and operating environments.  The
   recommended attributes will allow for better interoperability and the
   inclusion of more operating environments.  The mandatory and
   recommended attribute sets are traditional file or file system filesystem
   attributes.  The third type of attribute is the named attribute.  A
   named attribute is an opaque byte stream that is associated with a
   directory or file and referred to by a string name.  Named attributes
   are meant to be used by client applications as a method to associate
   application specific data with a regular file or directory.

   One significant addition to the recommended set of file attributes is
   the Access Control List (ACL) attribute.  This attribute provides for
   directory and file access control beyond the model used in previous
   versions of the NFS protocol.  The ACL definition allows for
   specification of user and group level access control.


1.1.3.3.  File System


1.2.3.3.  Filesystem Replication and Migration

   With the use of a special file attribute, the ability to migrate or
   replicate server file systems filesystems is enabled within the protocol.  The
   file system
   filesystem locations attribute provides a method for the client to
   probe the server about the location of a file system. filesystem.  In the event of
   a migration of a file system, filesystem, the client will receive an error when
   operating on the file system filesystem and it can then query as to the new file
   system location.  Similar steps are used for replication, the client
   is able to query the server for the multiple available locations of a
   particular file system. filesystem.  From this information, the client can use its
   own policies to access the appropriate file system filesystem location.


1.1.4.





Expires: February 2003                                         [Page 10]

Draft Specification      NFS version 4 Protocol              August 2002


1.2.4.  OPEN and CLOSE

   The NFS version 4 protocol introduces OPEN and CLOSE operations.  The
   OPEN operation provides a single point where file lookup, creation,
   and share semantics can be combined.  The CLOSE operation also
   provides for the release of state accumulated by OPEN.


1.1.5.


1.2.5.  File locking

   With the NFS version 4 protocol, the support for byte range file
   locking is part of the NFS protocol.  The file locking support is


Expires: May 2002                                              [Page 10]

Draft Specification      NFS version 4 Protocol            November 2001
   structured so that an RPC callback mechanism is not required.  This
   is a departure from the previous versions of the NFS file locking
   protocol, Network Lock Manager (NLM).  The state associated with file
   locks is maintained at the server under a lease-based model.  The
   server defines a single lease period for all state held by a NFS
   client.  If the client does not renew its lease within the defined
   period, all state associated with the client's lease may be released
   by the server.  The client may renew its lease with use of the RENEW
   operation or implicitly by use of other operations (primarily READ).


1.1.6.


1.2.6.  Client Caching and Delegation

   The file, attribute, and directory caching for the NFS version 4
   protocol is similar to previous versions.  Attributes and directory
   information are cached for a duration determined by the client.  At
   the end of a predefined timeout, the client will query the server to
   see if the related file system filesystem object has been updated.

   For file data, the client checks its cache validity when the file is
   opened.  A query is sent to the server to determine if the file has
   been changed.  Based on this information, the client determines if
   the data cache for the file should kept or released.  Also, when the
   file is closed, any modified data is written to the server.

   If an application wants to serialize access to file data, file
   locking of the file data ranges in question should be used.

   The major addition to NFS version 4 in the area of caching is the
   ability of the server to delegate certain responsibilities to the
   client.  When the server grants a delegation for a file to a client,
   the client is guaranteed certain semantics with respect to the
   sharing of that file with other clients.  At OPEN, the server may
   provide the client either a read or write delegation for the file.
   If the client is granted a read delegation, it is assured that no
   other client has the ability to write to the file for the duration of
   the delegation.  If the client is granted a write delegation, the
   client is assured that no other client has read or write access to
   the file.



Expires: February 2003                                         [Page 11]

Draft Specification      NFS version 4 Protocol              August 2002


   Delegations can be recalled by the server.  If another client
   requests access to the file in such a way that the access conflicts
   with the granted delegation, the server is able to notify the initial
   client and recall the delegation.  This requires that a callback path
   exist between the server and client.  If this callback path does not
   exist, then delegations can not be granted.  The essence of a
   delegation is that it allows the client to locally service operations
   such as OPEN, CLOSE, LOCK, LOCKU, READ, WRITE without immediate
   interaction with the server.





Expires: May 2002                                              [Page 11]

Draft Specification      NFS version 4 Protocol            November 2001


1.2.


1.3.  General Definitions

   The following definitions are provided for the purpose of providing
   an appropriate context for the reader.


   Client    The "client" is the entity that accesses the NFS server's
             resources.  The client may be an application which contains
             the logic to access the NFS server directly.  The client
             may also be the traditional operating system client remote
             file system
             filesystem services for a set of applications.

             In the case of file locking the client is the entity that
             maintains a set of locks on behalf of one or more
             applications.  This client is responsible for crash or
             failure recovery for those locks it manages.

             Note that multiple clients may share the same transport and
             multiple clients may exist on the same network node.

   Clientid  A 64-bit quantity used as a unique, short-hand reference to
             a client supplied Verifier and ID.  The server is
             responsible for supplying the Clientid.

   Lease     An interval of time defined by the server for which the
             client is irrevocably granted a lock.  At the end of a
             lease period the lock may be revoked if the lease has not
             been extended.  The lock must be revoked if a conflicting
             lock has been granted after the lease interval.

             All leases granted by a server have the same fixed
             interval.  Note that the fixed interval was chosen to
             alleviate the expense a server would have in maintaining
             state about variable length leases across server failures.

   Lock      The term "lock" is used to refer to both record (byte-
             range) locks as well as file (share) locks share reservations unless
             specifically stated otherwise.

   Server    The "Server" is the entity responsible for coordinating
             client access to a set of file systems.

   Stable Storage
             NFS version 4 servers must filesystems.


Expires: February 2003                                         [Page 12]

Draft Specification      NFS version 4 Protocol              August 2002


   Stable Storage
             NFS version 4 servers must be able to recover without data
             loss from multiple power failures (including cascading
             power failures, that is, several power failures in quick
             succession), operating system failures, and hardware
             failure of components other than the storage medium itself
             (for example, disk, nonvolatile RAM).

             Some examples of stable storage that are allowable for an
             NFS server include:


Expires: May 2002                                              [Page 12]

Draft Specification      NFS version 4 Protocol            November 2001

             1. Media commit of data, that is, the modified data has
                been successfully written to the disk media,
                for example, the disk platter.

             2. An immediate reply disk drive with battery-backed
                on-drive intermediate storage or uninterruptible power
                system (UPS).

             3. Server commit of data with battery-backed intermediate
                storage and recovery software.

             4. Cache commit with uninterruptible power system (UPS)
                and recovery software.

   Stateid   A 64-bit 128-bit quantity returned by a server that uniquely
             defines the open and locking state granted provided by the server
             for a specific open or lock owner for a specific file.

             Stateids composed of all bits 0 or all bits 1 have special
             meaning and are reserved values.

   Verifier  A 64-bit quantity generated by the client that the server
             can use to determine if the client has restarted and lost
             all previous lock state.



















Expires: May 2002 February 2003                                         [Page 13]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


2.  Protocol Data Types

   The syntax and semantics to describe the data types of the NFS
   version 4 protocol are defined in the XDR [RFC1832] and RPC [RFC1831]
   documents.  The next sections build upon the XDR data types to define
   types and structures specific to this protocol.

2.1.  Basic Data Types


   Data Type     Definition
   _____________________________________________________________________
   int32_t       typedef int             int32_t;

   uint32_t      typedef unsigned int    uint32_t;

   int64_t       typedef hyper           int64_t;

   uint64_t      typedef unsigned hyper  uint64_t;

   attrlist4     typedef opaque        attrlist4<>;
                 Used for file/directory attributes

   bitmap4       typedef uint32_t        bitmap4<>;
                 Used in attribute array encoding.

   changeid4     typedef       uint64_t        changeid4;
                 Used in definition of change_info

   clientid4     typedef uint64_t        clientid4;
                 Shorthand reference to client identification

   component4    typedef utf8string      component4;
                 Represents path name components

   count4        typedef uint32_t        count4;
                 Various count parameters (READ, WRITE, COMMIT)

   length4       typedef uint64_t        length4;
                 Describes LOCK lengths

   linktext4     typedef utf8string      linktext4;
                 Symbolic link contents

   mode4         typedef uint32_t        mode4;
                 Mode attribute data type

   nfs_cookie4   typedef uint64_t        nfs_cookie4;
                 Opaque cookie value for READDIR

   nfs_fh4       typedef opaque          nfs_fh4<NFS4_FHSIZE>;
                 Filehandle definition; NFS4_FHSIZE is defined as 128


Expires: May 2002 February 2003                                         [Page 14]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002



   nfs_ftype4    enum nfs_ftype4;
                 Various defined file types

   nfsstat4      enum nfsstat4;
                 Return value for operations

   offset4       typedef uint64_t        offset4;
                 Various offset designations (READ, WRITE, LOCK, COMMIT)

   pathname4     typedef component4      pathname4<>;
                 Represents path name for LOOKUP, OPEN and others

   qop4          typedef uint32_t        qop4;
                 Quality of protection designation in SECINFO

   sec_oid4      typedef opaque          sec_oid4<>;
                 Security Object Identifier
                 The sec_oid4 data type is not really opaque.
                 Instead contains an ASN.1 OBJECT IDENTIFIER as used
                 by GSS-API in the mech_type argument to
                 GSS_Init_sec_context.  See [RFC2078] [RFC2743] for details.

   seqid4        typedef uint32_t        seqid4;
                 Sequence identifier used for file locking

   utf8string    typedef opaque          utf8string<>;
                 UTF-8 encoding for strings

   verifier4     typedef opaque        verifier4[NFS4_VERIFIER_SIZE];
                 Verifier used for various operations (COMMIT, CREATE,
                 OPEN, READDIR, SETCLIENTID, SETCLIENTID_CONFIRM, WRITE)
                 NFS4_VERIFIER_SIZE is defined as 8


2.2.  Structured Data Types


   nfstime4
                  struct nfstime4 {
                          int64_t seconds;
                          uint32_t nseconds;
                  }

        The nfstime4 structure gives the number of seconds and
        nanoseconds since midnight or 0 hour January 1, 1970 Coordinated
        Universal Time (UTC).  Values greater than zero for the seconds
        field denote dates after the 0 hour January 1, 1970.  Values
        less than zero for the seconds field denote dates before the 0
        hour January 1, 1970.  In both cases, the nseconds field is to
        be added to the seconds field for the final time representation.
        For example, if the time to be represented is one-half second


Expires: February 2003                                         [Page 15]

Draft Specification      NFS version 4 Protocol              August 2002


        before 0 hour January 1, 1970, the seconds field would have a


Expires: May 2002                                              [Page 15]

Draft Specification      NFS version 4 Protocol            November 2001
        value of negative one (-1) and the nseconds fields would have a
        value of one-half second (500000000).  Values greater than
        999,999,999 for nseconds are considered invalid.

        This data type is used to pass time and date information.  A
        server converts to and from its local representation of time
        when processing time values, preserving as much accuracy as
        possible. If the precision of timestamps stored for a file
        system filesystem
        object is less than defined, loss of precision can occur.  An
        adjunct time maintenance protocol is recommended to reduce
        client and server time skew.


   time_how4

                  enum time_how4 {
                          SET_TO_SERVER_TIME4 = 0,
                          SET_TO_CLIENT_TIME4 = 1
                  };


   settime4

                  union settime4 switch (time_how4 set_it) {
                   case SET_TO_CLIENT_TIME4:
                           nfstime4       time;
                   default:
                           void;
                  };

        The above definitions are used as the attribute definitions to
        set time values.  If set_it is SET_TO_SERVER_TIME4, then the
        server uses its local representation of time for the time value.


   specdata4

                  struct specdata4 {
                          uint32_t specdata1; /* major device number */
                          uint32_t specdata2; /* minor device number */
                  };

        This data type represents additional information for the device
        file types NF4CHR and NF4BLK.


   fsid4

                  struct fsid4 {
                    uint64_t        major;
                    uint64_t        minor;
                  };


Expires: May 2002 February 2003                                         [Page 16]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


                  };

        This type is the file system filesystem identifier that is used as a
        mandatory attribute.


   fs_location4

                  struct fs_location4 {
                          utf8string    server<>;
                          pathname4     rootpath;
                  };


   fs_locations4

                  struct fs_locations4 {
                          pathname4     fs_root;
                          fs_location4  locations<>;
                  };

        The fs_location4 and fs_locations4 data types are used for the
        fs_locations recommended attribute which is used for migration
        and replication support.


   fattr4

                  struct fattr4 {
                          bitmap4       attrmask;
                          attrlist4     attr_vals;
                  };

        The fattr4 structure is used to represent file and directory
        attributes.

        The bitmap is a counted array of 32 bit integers used to contain
        bit values.  The position of the integer in the array that
        contains bit n can be computed from the expression (n / 32) and
        its bit within that integer is (n mod 32).

                                      0            1
                    +-----------+-----------+-----------+--
                    |  count    | 31  ..  0 | 63  .. 32 |
                    +-----------+-----------+-----------+--


   change_info4

                  struct change_info4 {
                          bool          atomic;
                          changeid4     before;
                          changeid4     after;
                  };


Expires: May 2002 February 2003                                         [Page 17]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


                          changeid4     after;
                  };

        This structure is used with the CREATE, LINK, REMOVE, RENAME
        operations to let the client the know the value of the change
        attribute for the directory in which the target file system filesystem
        object resides.


   clientaddr4

                  struct clientaddr4 {
                          /* see struct rpcb in RFC 1833 RFC1833 */
                          string r_netid<>;    /* network id */
                          string r_addr<>;     /* universal address */
                  };

        The clientaddr4 structure is used as part of the SETCLIENT SETCLIENTID
        operation to either specify the address of the client that is
        using a clientid or as part of the call back callback registration.  The
        r_netid and r_addr fields are specified in [RFC1833], but they
        are underspecified in [RFC1833] as far as what they should look
        like for specific protocols.

        For TCP over IPv4 and for UDP over IPv4, the format of r_addr is
        the US-ASCII string:

             h1.h2.h3.h4.p1.p2

        The prefix, "h1.h2.h3.h4", is the standard textual form for
        representing an IPv4 address, which is always four octets long.
        Assuming big-endian ordering, h1, h2, h3, and h4, are
        respectively, the first through fourth octets each converted to
        ASCII-decimal.  Assuming big-endian ordering, p1 and p2 are,
        respectively, the first and second octets each converted to
        ASCII-decimal. For example, if a host, in big-endian order, has
        an address of 0x0A010307 and there is a service listening on, in
        big endian order, port 0x020F (decimal 527), then complete
        universal address is "10.1.3.7.2.15".

        For TCP over IPv4 the value of r_netid is the string "tcp".  For
        UDP over IPv4 the value of r_netid is the string "udp".

        For TCP over IPv4 and for UDP over IPv6, the format of r_addr is
        the US-ASCII string:

             x1:x2:x3:x4:x5:x6:x7:x8.p1.p2

        The suffix "p1.p2" is the service port, and is computed the same
        way as with univeral addresses for TCP and UDP over IPv4. The
        prefix, "x1:x2:x3:x4:x5:x6:x7:x8", is the standard textual form
        for representing an IPv6 address as defined in Section 2.2 of


Expires: February 2003                                         [Page 18]

Draft Specification      NFS version 4 Protocol              August 2002


        [RFC1884].  Additionally, the two alternative forms specified in
        Section 2.2 of [RFC1884] are also acceptable.

        For TCP over IPv6 the value of r_netid is the string "tcp6".
        For UDP over IPv6 the value of r_netid is the string "udp6".


   cb_client4

                  struct cb_client4 {
                          unsigned int  cb_program;
                          clientaddr4   cb_location;
                  };

        This structure is used by the client to inform the server of its
        call back address; includes the program number and client
        address.


   nfs_client_id4

                  struct nfs_client_id4 {
                          verifier4     verifier;
                          opaque        id<>;        id<NFS4_OPAQUE_LIMIT>;
                  };

        This structure is part of the arguments to the SETCLIENTID
        operation.


   nfs_lockowner4  NFS4_OPAQUE_LIMIT is defined as 1024.


   open_owner4

                  struct nfs_lockowner4 open_owner4 {
                          clientid4     clientid;
                          opaque        owner<>;        owner<NFS4_OPAQUE_LIMIT>;
                  };

        This structure is used to identify the owner of open state.
        NFS4_OPAQUE_LIMIT is defined as 1024.



   lock_owner4

                  struct lock_owner4 {
                          clientid4     clientid;
                          opaque        owner<NFS4_OPAQUE_LIMIT>;
                  };

        This structure is used to identify the owner of a OPEN share or file lock. locking
        state.  NFS4_OPAQUE_LIMIT is defined as 1024.



Expires: May 2002 February 2003                                         [Page 18] 19]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


   open_to_lock_owner4

               struct open_to_lock_owner4 {
               seqid4          open_seqid;
               stateid4        open_stateid;
               seqid4          lock_seqid;
               lock_owner4     lock_owner;
               };

        This structure is used for the first LOCK operation done for an
        open_owner4.  It provides both the open_stateid and lock_owner
        such that the transition is made from a valid open_stateid
        sequence to that of the new lock_stateid sequence.  Using this
        mechanism avoids the confirmation of the lock_owner/lock_seqid
        pair since it is tied to established state in the form of the
        open_stateid/open_seqid.


   stateid4

                  struct stateid4 {
                    uint32_t        seqid;
                    opaque          other[12];
                  };

        This strucutre structure is used for the various state sharing mechanisms
        between the client and server.  For the client, this data
        structure is read-only.  The seqid starting value of the seqid field
        is undefined. The server is required to increment the only seqid
        field that monotonically at each transition of the client should interpret.  See stateid.  This is
        important since the section for client will inspect the seqid in OPEN
        operation for further description
        stateids to determine the order of how OPEN processing done by the seqid field is to
        be interpreted.
        server.





















Expires: May 2002 February 2003                                         [Page 19] 20]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


3.  RPC and Security Flavor

   The NFS version 4 protocol is a Remote Procedure Call (RPC)
   application that uses RPC version 2 and the corresponding eXternal
   Data Representation (XDR) as defined in [RFC1831] and [RFC1832].  The
   RPCSEC_GSS security flavor as defined in [RFC2203] MUST be used as
   the mechanism to deliver stronger security for the NFS version 4
   protocol.

3.1.  Ports and Transports

   Historically, NFS version 2 and version 3 servers have resided on
   port 2049.  The registered port 2049 [RFC1700] for the NFS protocol
   should be the default configuration.  Using the registered port for
   NFS services means the NFS client will not need to use the RPC
   binding protocols as described in [RFC1833]; this will allow NFS to
   transit firewalls.

   The transport used by the RPC service for the NFS version 4 protocol
   MUST provide congestion control comparable to that defined for TCP in
   [RFC2581].  If the operating environment implements TCP, the NFS
   version 4 protocol SHOULD be supported over TCP.  The NFS client and
   server may MAY use other transports if they support congestion control as
   defined above and in those cases a mechanism may be provided to
   override TCP usage in favor of another transport.

   If TCP is used as the transport, the client and server SHOULD use
   persistent connections.  This will prevent the weakening of TCP's
   congestion control via short lived connections and will improve
   performance for the WAN environment by eliminating the need for SYN
   handshakes.

   Note that for various timers, the client and server should avoid
   inadvertent synchronization of those timers.  For further discussion
   of the general issue refer to [Floyd].


3.2.  Security Flavors

   Traditional RPC implementations have included AUTH_NONE, AUTH_SYS,
   AUTH_DH, and AUTH_KRB4 as security flavors.  With [RFC2203] an
   additional security flavor


3.1.1.  Client Retransmission Behavior

   When processing a request received over a reliable transport such as
   TCP, the NFS version 4 server MUST NOT silently drop the request,
   except if the transport connection has been broken. Given such a
   contract between NFS version 4 clients and servers, clients MUST NOT
   retry a request unless one or both of the following are true:

   o    The transport connection has been broken

   o    The procedure being retried is the NULL procedure


   Since transports, including TCP, do not always synchronously inform a
   peer when the other peer has broken the connection (for example, when


Expires: February 2003                                         [Page 21]

Draft Specification      NFS version 4 Protocol              August 2002


   an NFS server reboots), so the NFS version 4 client may want to
   actively "probe" the connection to see if has been broken.  Use of
   the NULL procedure is one recommended way to do so.  So, when a
   client experiences a remote procedure call timeout (of some arbitrary
   implementation specific amount), rather than retrying the remote
   procedure call, it could instead issue a NULL procedure call to the
   server. If the server has died, the transport connection break will
   eventually be indicated to the NFS version 4 client. The client can
   then reconnect, and then retry the original request. If the NULL
   procedure call gets a response, the connection has not broken.  The
   client can decide to wait longer for the original request's response,
   or it can break the transport connection and reconnect before re-
   sending the original request.

   For callbacks from the server to the client, the same rules apply,
   but the server doing the callback becomes the client, and the client
   receiving the callback becomes the server.


3.2.  Security Flavors

   Traditional RPC implementations have included AUTH_NONE, AUTH_SYS,
   AUTH_DH, and AUTH_KRB4 as security flavors.  With [RFC2203] an
   additional security flavor of RPCSEC_GSS has been introduced which
   uses the functionality of GSS-API [RFC2078]. [RFC2743].  This allows for the use
   of varying various security mechanisms by the RPC layer without the
   additional implementation overhead of adding RPC security flavors.
   For NFS version 4, the RPCSEC_GSS security flavor MUST be used to
   enable the mandatory security mechanism.  Other flavors, such as,
   AUTH_NONE, AUTH_SYS, and AUTH_DH MAY be implemented as well.

3.2.1.  Security mechanisms for NFS version 4

   The use of RPCSEC_GSS requires selection of: mechanism, quality of


Expires: May 2002                                              [Page 20]

Draft Specification      NFS version 4 Protocol            November 2001
   protection, and service (authentication, integrity, privacy).  The
   remainder of this document will refer to these three parameters of
   the RPCSEC_GSS security as the security triple.

3.2.1.1.  Kerberos V5 as a security triple

   The Kerberos V5 GSS-API mechanism as described in [RFC1964] MUST be
   implemented and provide the following security triples.

 column descriptions:

 1 == number of pseudo flavor
 2 == name of pseudo flavor
 3 == mechanism's OID
 4 == mechanism's algorithm(s)
 5 == RPCSEC_GSS service

 1      2     3                    4              5


Expires: February 2003                                         [Page 22]

Draft Specification      NFS version 4 Protocol              August 2002


 -----------------------------------------------------------------------
 390003 krb5  1.2.840.113554.1.2.2 DES MAC MD5    rpc_gss_svc_none
 390004 krb5i 1.2.840.113554.1.2.2 DES MAC MD5    rpc_gss_svc_integrity
 390005 krb5p 1.2.840.113554.1.2.2 DES MAC MD5    rpc_gss_svc_privacy
                                   for integrity,
                                   and 56 bit DES
                                   for privacy.

   Note that the pseudo flavor is presented here as a mapping aid to the
   implementor.  Because this NFS protocol includes a method to
   negotiate security and it understands the GSS-API mechanism, the
   pseudo flavor is not needed.  The pseudo flavor is needed for NFS
   version 3 since the security negotiation is done via the MOUNT
   protocol.

   For a discussion of NFS' use of RPCSEC_GSS and Kerberos V5, please
   see [RFC2623].


3.2.1.2.  LIPKEY as a security triple

   The LIPKEY GSS-API mechanism as described in [RFC2847] MUST be
   implemented and provide the following security triples. The
   definition of the columns matches the previous subsection "Kerberos
   V5 as security triple"

 1      2        3                    4              5
 -----------------------------------------------------------------------
 390006 lipkey   1.3.6.1.5.5.9        negotiated  rpc_gss_svc_none
 390007 lipkey-i 1.3.6.1.5.5.9        negotiated  rpc_gss_svc_integrity
 390008 lipkey-p 1.3.6.1.5.5.9        negotiated  rpc_gss_svc_privacy

   The mechanism algorithm is listed as "negotiated".  This is because
   LIPKEY is layered on SPKM-3 and in SPKM-3 [RFC2847] the


Expires: May 2002                                              [Page 21]

Draft Specification      NFS version 4 Protocol            November 2001
   confidentiality and integrity algorithms are negotiated.  Since
   SPKM-3 specifies HMAC-MD5 for integrity as MANDATORY, 128 bit
   cast5CBC for confidentiality for privacy as MANDATORY, and further
   specifies that HMAC-MD5 and cast5CBC MUST be listed first before
   weaker algorithms, specifying "negotiated" in column 4 does not
   impair interoperability.  In the event an SPKM-3 peer does not
   support the mandatory algorithms, the other peer is free to accept or
   reject the GSS-API context creation.

   Because SPKM-3 negotiates the algorithms, subsequent calls to
   LIPKEY's GSS_Wrap() and GSS_GetMIC() by RPCSEC_GSS will use a quality
   of protection value of 0 (zero).  See section 5.2 of [RFC2025] for an
   explanation.

   LIPKEY uses SPKM-3 to create a secure channel in which to pass a user
   name and password from the client to the user. server.  Once the user name
   and password have been accepted by the server, calls to the LIPKEY
   context are redirected to the SPKM-3 context. See [RFC2847] for more


Expires: February 2003                                         [Page 23]

Draft Specification      NFS version 4 Protocol              August 2002


   details.


3.2.1.3.  SPKM-3 as a security triple

   The SPKM-3 GSS-API mechanism as described in [RFC2847] MUST be
   implemented and provide the following security triples. The
   definition of the columns matches the previous subsection "Kerberos
   V5 as security triple".

 1      2        3                    4              5
 -----------------------------------------------------------------------
 390009 spkm3    1.3.6.1.5.5.1.3      negotiated  rpc_gss_svc_none
 390010 spkm3i   1.3.6.1.5.5.1.3      negotiated  rpc_gss_svc_integrity
 390011 spkm3p   1.3.6.1.5.5.1.3      negotiated  rpc_gss_svc_privacy

   For a discussion as to why the mechanism algorithm is listed as
   "negotiated", see the previous section "LIPKEY as a security triple."

   Because SPKM-3 negotiates the algorithms, subsequent calls to SPKM-
   3's GSS_Wrap() and GSS_GetMIC() by RPCSEC_GSS will use a quality of
   protection value of 0 (zero). See section 5.2 of [RFC2025] for an
   explanation.

   Even though LIPKEY is layered over SPKM-3, SPKM-3 is specified as a
   mandatory set of triples to handle the situations where the initiator
   (the client) is anonymous or where the initiator has its own
   certificate.  If the initiator is anonymous, there will not be a user
   name and password to send to the target (the server).  If the
   initiator has its own certificate, then using passwords is
   superfluous.





Expires: May 2002                                              [Page 22]

Draft Specification      NFS version 4 Protocol            November 2001


3.3.  Security Negotiation

   With the NFS version 4 server potentially offering multiple security
   mechanisms, the client needs a method to determine or negotiate which
   mechanism is to be used for its communication with the server.  The
   NFS server may have multiple points within its file system filesystem name space
   that are available for use by NFS clients.  In turn the NFS server
   may be configured such that each of these entry points may have
   different or multiple security mechanisms in use.

   The security negotiation between client and server must be done with
   a secure channel to eliminate the possibility of a third party
   intercepting the negotiation sequence and forcing the client and
   server to choose a lower level of security than required or desired.
   See the section "Security Considerations" for further discussion.






Expires: February 2003                                         [Page 24]

Draft Specification      NFS version 4 Protocol              August 2002


3.3.1.  SECINFO

   The new SECINFO operation will allow the client to determine, on a
   per filehandle basis, what security triple is to be used for server
   access.  In general, the client will not have to use the SECINFO
   operation except during initial communication with the server or when
   the client crosses policy boundaries at the server.  It is possible
   that the server's policies change during the client's interaction
   therefore forcing the client to negotiate a new security triple.


3.3.2.  Security Error

   Based on the assumption that each NFS version 4 client and server
   must support a minimum set of security (i.e. LIPKEY, SPKM-3, and
   Kerberos-V5 all under RPCSEC_GSS), the NFS client will start its
   communication with the server with one of the minimal security
   triples.  During communication with the server, the client may
   receive an NFS error of NFS4ERR_WRONGSEC.  This error allows the
   server to notify the client that the security triple currently being
   used is not appropriate for access to the server's file system filesystem
   resources.  The client is then responsible for determining what
   security triples are available at the server and choose one which is
   appropriate for the client.


3.3.2.  SECINFO

   The new SECINFO operation will allow  See the client to determine, on a
   per filehandle basis, what security triple is to be used section for server
   access.  In general, the "SECINFO"
   operation for further discussion of how the client will not have respond to
   the NFS4ERR_WRONGSEC error and use SECINFO.


3.4.  Callback RPC Authentication

   Except as noted elsewhere in this section, the SECINFO
   procedure except during initial communication with callback RPC
   (described later) MUST mutually authenticate the NFS server or when
   the client crosses policy boundaries at the server.  It is possible
   that the server's policies change during the client's interaction
   therefore forcing the client to negotiate a new security triple.


3.4.  Callback RPC Authentication

   The callback RPC (described later) must mutually authenticate the NFS
   server to to the
   principal that acquired the clientid (also described later), using
   the same security flavor the original SETCLIENTID operation used. Because LIPKEY is layered over SPKM-3, it is
   permissible for the server to use SPKM-3 and not LIPKEY for the
   callback even if the client used LIPKEY for SETCLIENTID.

   For AUTH_NONE, there are no principals, so this is a non-issue.


Expires: May 2002                                              [Page 23]

Draft Specification      NFS version 4 Protocol            November 2001


   For AUTH_SYS,

   AUTH_SYS has no notions of mutual authentation or a server principal,
   so the callback from the server simply uses the AUTH_SYS credential
   that the user used when it he set up the delegation.

   For AUTH_DH, one commonly used convention is that the server uses the
   credential corresponding to this AUTH_DH principal:

           unix.host@domain

   where host and domain are variables corresponding to the name of
   server host and directory services domain in which it lives such as a
   Network Information System domain or a DNS domain.

   Because LIPKEY is layered over SPKM-3, it is permissible for the
   server to use SPKM-3 and not LIPKEY for the callback even if the


Expires: February 2003                                         [Page 25]

Draft Specification      NFS version 4 Protocol              August 2002


   client used LIPKEY for SETCLIENTID.

   Regardless of what security mechanism under RPCSEC_GSS is being used,
   the NFS server, MUST identify itself in GSS-API via a
   GSS_C_NT_HOSTBASED_SERVICE name type.  GSS_C_NT_HOSTBASED_SERVICE
   names are of the form:

           service@hostname

   For NFS, the "service" element is

           nfs

   Implementations of security mechanisms will convert nfs@hostname to
   various different forms. For Kerberos V5 and LIPKEY, the following
   form is RECOMMENDED:

           nfs/hostname

   For Kerberos V5, nfs/hostname would be a server principal in the
   Kerberos Key Distribution Center database.  For LIPKEY, this would be
   the username passed to the target (the NFS version 4 client that
   receives the callback).

   It should be noted that LIPKEY may not work for callbacks, since the
   LIPKEY client uses a user id/password.  If the NFS client receiving
   the callback can authenticate the NFS server's user name/password
   pair, and if the user that the NFS server is authenticating to has a
   public key certificate, then it works.

   In situations where the NFS client uses LIPKEY and uses a per-host
   principal for the SETCLIENTID operation, instead of using LIPKEY for
   SETCLIENTID, it is RECOMMENDED that SPKM-3 with mutual authentication
   be used.  This effectively means that the client will use a
   certificate to authenticate and identify the initiator to the target
   on the NFS server.  Using SPKM-3 and not LIPKEY has the following
   advantages:

   o    When the server does a callback, it must authenticate to the
        principal used in the SETCLIENTID.  Even if LIPKEY is used,
        because LIPKEY is layered over SPKM-3, the NFS client will need
        to have a certificate that corresponds to the principal used in


Expires: May 2002                                              [Page 24]

Draft Specification      NFS version 4 Protocol            November 2001
        the SETCLIENTID operation.  From an administrative perspective,
        having a user name, password, and certificate for both the
        client and server is redundant.

   o    LIPKEY was intended to minimize additional infrastructure
        requirements beyond a certificate for the target, and the
        expectation is that existing password infrastructure can be
        leveraged for the initiator.  In some environments, a per-host
        password does not exist yet.  If certificates are used for any
        per-host principals, then additional password infrastructure is


Expires: February 2003                                         [Page 26]

Draft Specification      NFS version 4 Protocol              August 2002


        not needed.

   o    In cases when a host is both an NFS client and server, it can
        share the same per-host certificate.


















































Expires: May 2002 February 2003                                         [Page 25] 27]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


4.  Filehandles

   The filehandle in the NFS protocol is a per server unique identifier
   for a file system filesystem object.  The contents of the filehandle are opaque
   to the client.  Therefore, the server is responsible for translating
   the filehandle to an internal representation of the file system
   object.  Since the filehandle is the client's reference to an object
   and the client may cache this reference, the server SHOULD not reuse
   a filehandle for another file system filesystem
   object.  If the server needs to
   reuse a filehandle value, the time elapsed before reuse SHOULD be
   large enough such that it is unlikely the client has a cached copy of
   the reused filehandle value.  Note that a client may cache a
   filehandle for a very long time.  For example, a client may cache NFS
   data to local storage as a method to expand its effective cache size
   and as a means to survive client restarts.  Therefore, the lifetime
   of a cached filehandle may be extended.


4.1.  Obtaining the First Filehandle

   The operations of the NFS protocol are defined in terms of one or
   more filehandles.  Therefore, the client needs a filehandle to
   initiate communication with the server.  With the NFS version 2
   protocol [RFC1094] and the NFS version 3 protocol [RFC1813], there
   exists an ancillary protocol to obtain this first filehandle.  The
   MOUNT protocol, RPC program number 100005, provides the mechanism of
   translating a string based file system filesystem path name to a filehandle which
   can then be used by the NFS protocols.

   The MOUNT protocol has deficiencies in the area of security and use
   via firewalls.  This is one reason that the use of the public
   filehandle was introduced in [RFC2054] and [RFC2055].  With the use
   of the public filehandle in combination with the LOOKUP procedure operation in
   the NFS version 2 and 3 protocols, it has been demonstrated that the
   MOUNT protocol is unnecessary for viable interaction between NFS
   client and server.

   Therefore, the NFS version 4 protocol will not use an ancillary
   protocol for translation from string based path names to a
   filehandle.  Two special filehandles will be used as starting points
   for the NFS client.


4.1.1.  Root Filehandle

   The first of the special filehandles is the ROOT filehandle.  The
   ROOT filehandle is the "conceptual" root of the file system filesystem name space
   at the NFS server.  The client uses or starts with the ROOT
   filehandle by employing the PUTROOTFH operation.  The PUTROOTFH
   operation instructs the server to set the "current" filehandle to the
   ROOT of the server's file tree.  Once this PUTROOTFH operation is
   used, the client can then traverse the entirety of the server's file


Expires: May 2002                                              [Page 26]

Draft Specification      NFS version 4 Protocol            November 2001
   tree with the LOOKUP procedure. operation.  A complete discussion of the server
   name space is in the section "NFS Server Name Space".


4.1.2.  Public Filehandle

   The second special filehandle is the PUBLIC filehandle.  Unlike the
   ROOT filehandle, the PUBLIC filehandle may be bound or represent an
   arbitrary file system filesystem object at the server.  The server is responsible


Expires: February 2003                                         [Page 28]

Draft Specification      NFS version 4 Protocol              August 2002


   for this binding.  It may be that the PUBLIC filehandle and the ROOT
   filehandle refer to the same file system filesystem object.  However, it is up to
   the administrative software at the server and the policies of the
   server administrator to define the binding of the PUBLIC filehandle
   and server file system filesystem object.  The client may not make any
   assumptions about this binding. The client uses the PUBLIC filehandle
   via the PUTPUBFH operation.


4.2.  Filehandle Types

   In the NFS version 2 and 3 protocols, there was one type of
   filehandle with a single set of semantics.  The NFS version 4
   protocol introduces a new type of filehandle in an attempt to
   accommodate certain server environments.  The first  This type of filehandle
   is 'persistent'. termed "persistent" in NFS Version 4.  The semantics of a
   persistent filehandle
   are remain the same as the filehandles of the NFS version 2 and 3 protocols.
   The second or before.  A new type of
   filehandle introduced in NFS Version 4 is the "volatile" filehandle. filehandle,
   which attempts to accommodate certain server environments.

   The volatile filehandle type is being was introduced to address server
   functionality or implementation issues which make correct
   implementation of a persistent filehandle infeasible.  Some server
   environments do not provide a file system filesystem level invariant that can be
   used to construct a persistent filehandle.  The underlying server
   file system
   filesystem may not provide the invariant or the server's file system filesystem
   programming interfaces may not provide access to the needed
   invariant.  Volatile filehandles may ease the implementation of
   server functionality such as hierarchical storage management or file
   system
   filesystem reorganization or migration.  However, the volatile
   filehandle increases the implementation burden for the client.  However this
   increased burden is deemed acceptable based on the overall gains
   achieved by the protocol.

   Since the client will need to handle persistent and volatile
   filehandle
   filehandles differently, a file attribute is defined which may be
   used by the client to determine the filehandle types being returned
   by the server.


4.2.1.  General Properties of a Filehandle

   The filehandle contains all the information the server needs to
   distinguish an individual file.  To the client, the filehandle is
   opaque. The client stores filehandles for use in a later request and


Expires: May 2002                                              [Page 27]

Draft Specification      NFS version 4 Protocol            November 2001
   can compare two filehandles from the same server for equality by
   doing a byte-by-byte comparison.  However, the client MUST NOT
   otherwise interpret the contents of filehandles.  If two filehandles
   from the same server are equal, they MUST refer to the same file.  If
   they are not equal, the client may use information provided by the
   server, in the form of file attributes, to determine whether they
   denote the same files or different files.  The client would do this
   as necessary for client side caching.
   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 assumpions which might cause
   incorrect behavior.  Further discussion of filehandle and attribute


Expires: February 2003                                         [Page 29]

Draft Specification      NFS version 4 Protocol              August 2002


   comparison in the context of data caching is presented in the section
   "Data Caching and File Identity".

   As an example, in the case that two different path names when
   traversed at the server terminate at the same file system filesystem object, the
   server SHOULD return the same filehandle for each path.  This can
   occur if a hard link is used to create two file names which refer to
   the same underlying file object and associated data.  For example, if
   paths /a/b/c and /a/d/c refer to the same file, the server SHOULD
   return the same filehandle for both path names traversals.


4.2.2.  Persistent Filehandle

   A persistent filehandle is defined as having a fixed value for the
   lifetime of the file system filesystem object to which it refers.  Once the
   server creates the filehandle for a file system filesystem object, the server
   MUST accept the same filehandle for the object for the lifetime of
   the object.  If the server restarts or reboots the NFS server must
   honor the same filehandle value as it did in the server's previous
   instantiation.  Similarly, if the file system filesystem is migrated, the new NFS
   server must honor the same file handle filehandle as the old NFS server.

   The persistent filehandle will be become stale or invalid when the
   file system
   filesystem object is removed.  When the server is presented with a
   persistent filehandle that refers to a deleted object, it MUST return
   an error of NFS4ERR_STALE.  A filehandle may become stale when the
   file system
   filesystem containing the object is no longer available.  The file
   system may become unavailable if it exists on removable media and the
   media is no longer available at the server or the file system filesystem in whole
   has been destroyed or the file system filesystem has simply been removed from the
   server's name space (i.e. unmounted in a Unix UNIX environment).


4.2.3.  Volatile Filehandle

   A volatile filehandle does not share the same longevity


Expires: May 2002                                              [Page 28]

Draft Specification      NFS version 4 Protocol            November 2001
   characteristics of a persistent filehandle.  The server may determine
   that a volatile filehandle is no longer valid at many different
   points in time.  If the server can definitively determine that a
   volatile filehandle refers to an object that has been removed, the
   server should return NFS4ERR_STALE to the client (as is the case for
   persistent filehandles).  In all other cases where the server
   determines that a volatile filehandle can no longer be used, it
   should return an error of NFS4ERR_FHEXPIRED.

   The mandatory attribute "fh_expire_type" is used by the client to
   determine what type of filehandle the server is providing for a
   particular file system. filesystem.  This attribute is a bitmask with the
   following values:




Expires: February 2003                                         [Page 30]

Draft Specification      NFS version 4 Protocol              August 2002


   FH4_PERSISTENT
        The value of FH4_PERSISTENT is used to indicate a persistent
        filehandle, which is valid until the object is removed from the
        file system.
        filesystem.  The server will not return NFS4ERR_FHEXPIRED for
        this filehandle.  FH4_PERSISTENT is defined as a value in which
        none of the bits specified below are set.

   FH4_NOEXPIRE_WITH_OPEN

   FH4_VOLATILE_ANY
        The filehandle will not may expire while client has the file open. at any time, except as specifically
        excluded (i.e. FH4_NO_EXPIRE_WITH_OPEN).

   FH4_NOEXPIRE_WITH_OPEN
        May only be set when FH4_VOLATILE_ANY is set.  If this bit is
        set, then the values meaning of FH4_VOLATILE_ANY or
        FH4_VOL_RENAME do not impact expiration while the file is open.
        Once the file is closed or if the FH4_NOEXPIRE_WITH_OPEN bit is
        false, the rest qualified to
        exclude any expiration of the volatile related bits apply.

   FH4_VOLATILE_ANY
        The filehandle may expire at any time and will expire during
        system migration and rename. when it is open.

   FH4_VOL_MIGRATION
        The filehandle will expire during file system as a result of migration.  May
        only be set if FH4_VOLATILE_ANY  If
        FH4_VOL_ANY is not set. set, FH4_VOL_MIGRATION is redundant.

   FH4_VOL_RENAME
        The filehandle may will expire due to a during rename.  This includes a
        rename by the requesting client or a rename by another any other client.
        May only be set if FH4_VOLATILE_ANY
        If FH4_VOL_ANY is not set. set, FH4_VOL_RENAME is redundant.

        Servers which provide volatile filehandles that may expire while
        open (i.e. if FH4_VOL_MIGRATION or FH4_VOL_RENAME is set or if
        FH4_VOLATILE_ANY is set and FH4_NOEXPIRE_WITH_OPEN not set),
        should deny a RENAME or REMOVE that would affect an OPEN file or of
        any of the components leading to the OPEN file.  In addition,
        the server should deny all RENAME or REMOVE requests during the
        grace or lease period upon server restart.

   The reader may be wondering why there are three FH4_VOL*

        Note that the bits and why
   FH4_VOLATILE_ANY is exclusive of FH4_VOL_MIGRATION and
   FH4_VOL_RENAME.  If the a filehandle is normally persistent but
   cannot persist across a file set migration, then the presence of the


Expires: May 2002                                              [Page 29]

Draft Specification      NFS version 4 Protocol            November 2001


   FH4_VOL_MIGRATION or FH4_VOL_RENAME tells allow
        the client to determine that it can
   treat the file handle as persistent for purposes of maintaining expiration has occurred whenever a
   file name to file handle cache, except for the
        specific event
   described by the bit.  However, FH4_VOLATILE_ANY tells occurs, without an explicit filehandle expiration
        error from the client
   that it should server.  FH4_VOL_ANY does not maintain such a cache for unopened files.  A provide this form
        of information. In situations where the server MUST will expire many,
        but not present all filehandles upon migration (e.g. all but those that
        are open), FH4_VOLATILE_ANY with FH4_VOL_MIGRATION or
   FH4_VOL_RENAME as (in this will lead to confusion.  FH4_VOLATILE_ANY
   implies that case with
        FH4_NOEXPIRE_WITH_OPEN) is a better choice since the file handle client may
        not assume that all filehandles will expire upon when migration or rename,
        occurs, and it is likely that additional expirations will occur
        (as a result of file CLOSE) that are separated in
   addition to other events. time from the
        migration event itself.


4.2.4.  One Method of Constructing a Volatile Filehandle

   As mentioned, in some instances a filehandle is stale (no longer
   valid; perhaps because the file was removed from the server) or it is
   expired (the underlying file is valid but since the filehandle is


Expires: February 2003                                         [Page 31]

Draft Specification      NFS version 4 Protocol              August 2002


   volatile, it may have expired).  Thus the server needs to be able to
   return NFS4ERR_STALE in the former case and NFS4ERR_FHEXPIRED in the
   latter case. This can be done by careful construction of the volatile
   filehandle.  One possible implementation follows.

   A volatile filehandle, while opaque to the client could contain:

   [volatile bit = 1 | server boot time | slot | generation number]


   o    slot is an index in the server volatile filehandle table

   o    generation number is the generation number for the table
        entry/slot

   If the server boot time is less than the current server boot time,
   return NFS4ERR_FHEXPIRED.  If slot is out of range, return
   NFS4ERR_BADHANDLE.  If the generation number does not match, return
   NFS4ERR_FHEXPIRED.

   When the server reboots, the table is gone (it is volatile).

   If volatile bit is 0, then it is a persistent filehandle with a
   different structure following it.


4.3.  Client Recovery from Filehandle Expiration

   If possible, the client SHOULD recover from the receipt of an
   NFS4ERR_FHEXPIRED error.  The client must take on additional
   responsibility so that it may prepare itself to recover from the
   expiration of a volatile filehandle.  If the server returns
   persistent filehandles, the client does not need these additional
   steps.



Expires: May 2002                                              [Page 30]

Draft Specification      NFS version 4 Protocol            November 2001

   For volatile filehandles, most commonly the client will need to store
   the component names leading up to and including the file system filesystem object
   in question.  With these names, the client should be able to recover
   by finding a filehandle in the name space that is still available or
   by starting at the root of the server's file system filesystem name space.

   If the expired filehandle refers to an object that has been removed
   from the file system, filesystem, obviously the client will not be able to recover
   from the expired filehandle.

   It is also possible that the expired filehandle refers to a file that
   has been renamed.  If the file was renamed by another client, again
   it is possible that the original client will not be able to recover.
   However, in the case that the client itself is renaming the file and
   the file is open, it is possible that the client may be able to
   recover.  The client can determine the new path name based on the
   processing of the rename request.  The client can then regenerate the


Expires: February 2003                                         [Page 32]

Draft Specification      NFS version 4 Protocol              August 2002


   new filehandle based on the new path name.  The client could also use
   the compound operation mechanism to construct a set of operations
   like:
           RENAME A B
           LOOKUP B
           GETFH
   Note that the COMPOUND procedure does not provide atomicity.  This
   example only reduces the overhead of recovering from an expired
   filehandle.













































Expires: May 2002 February 2003                                         [Page 31] 33]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


5.  File Attributes

   To meet the requirements of extensibility and increased
   interoperability with non-Unix non-UNIX platforms, attributes must be handled
   in a flexible manner.  The NFS Version version 3 fattr3 structure contains a
   fixed list of attributes that not all clients and servers are able to
   support or care about.  The fattr3 structure can not be extended as
   new needs arise and it provides no way to indicate non-support.  With
   the NFS Version version 4 protocol, the client will be is able to ask query what attributes
   the server supports and will be able to request construct requests with only those supported
   attributes in which it is interested. (or a subset thereof).

   To this end, attributes will be are divided into three groups: mandatory,
   recommended, and named.  Both mandatory and recommended attributes
   are supported in the NFS version 4 protocol by a specific and well-
   defined encoding and are identified by number.  They are requested by
   setting a bit in the bit vector sent in the GETATTR request; the
   server response includes a bit vector to list what attributes were
   returned in the response.  New mandatory or recommended attributes
   may be added to the NFS protocol between major revisions by
   publishing a standards-track RFC which allocates a new attribute
   number value and defines the encoding for the attribute.  See the
   section "Minor Versioning" for further discussion.

   Named attributes are accessed by the new OPENATTR operation, which
   accesses a hidden directory of attributes associated with a file
   system object.  OPENATTR takes a filehandle for the object and
   returns the filehandle for the attribute hierarchy.  The filehandle
   for the named attributes is a directory object accessible by LOOKUP
   or READDIR and contains files whose names represent the named
   attributes and whose data bytes are the value of the attribute.  For
   example:


          LOOKUP     "foo"       ; look up file
          GETATTR    attrbits
          OPENATTR               ; access foo's named attributes
          LOOKUP     "x11icon"   ; look up specific attribute
          READ       0,4096      ; read stream of bytes


   Named attributes are intended for data needed by applications rather
   than by an NFS client implementation.  NFS implementors are strongly
   encouraged to define their new attributes as recommended attributes
   by bringing them to the IETF standards-track process.

   The set of attributes which are classified as mandatory is
   deliberately small since servers must do whatever it takes to support
   them.  The recommended attributes may be unsupported; though a  A server should support as many of the recommended attributes
   as it can. possible but by their definition, the server is not required to
   support all of them.  Attributes are deemed mandatory if the data is
   both needed by a large number of clients and is not otherwise


Expires: February 2003                                         [Page 34]

Draft Specification      NFS version 4 Protocol              August 2002


   reasonably computable by the client when support is not


Expires: May 2002                                              [Page 32]

Draft Specification      NFS version 4 Protocol            November 2001 provided on
   the server.

   Note that the hidden directory returned by OPENATTR is a convenience
   for protocol processing.  The client should not make any assumptions
   about the server's implementation of named attributes and whether the
   underlying filesystem at the server has a named attribute directory
   or not.  Therefore, operations such as SETATTR and GETATTR on the
   named attribute directory are undefined.


5.1.  Mandatory Attributes

   These MUST be supported by every NFS Version version 4 client and server in
   order to ensure a minimum level of interoperability.  The server must
   store and return these attributes and the client must be able to
   function with an attribute set limited to these attributes.  With
   just the mandatory attributes some client functionality may be
   impaired or limited in some ways.  A client may ask for any of these
   attributes to be returned by setting a bit in the GETATTR request and
   the server must return their value.


5.2.  Recommended Attributes

   These attributes are understood well enough to warrant support in the
   NFS Version version 4 protocol.  However, they may not be supported on all
   clients and servers.  A client may ask for any of these attributes to
   be returned by setting a bit in the GETATTR request but must handle
   the case where the server does not return them.  A client may ask for
   the set of attributes the server supports and should not request
   attributes the server does not support.  A server should be tolerant
   of requests for unsupported attributes and simply not return them
   rather than considering the request an error.  It is expected that
   servers will support all attributes they comfortably can and only
   fail to support attributes which are difficult to support in their
   operating environments.  A server should provide attributes whenever
   they don't have to "tell lies" to the client.  For example, a file
   modification time should be either an accurate time or should not be
   supported by the server.  This will not always be comfortable to
   clients but it seems that the client has a is better ability positioned decide whether and how to
   fabricate or construct an attribute or whether to do without the
   attribute.



5.3.  Named Attributes

   These attributes are not supported by direct encoding in the NFS
   Version 4 protocol but are accessed by string names rather than
   numbers and correspond to an uninterpreted stream of bytes which are
   stored with the file system filesystem object.  The name space for these


Expires: February 2003                                         [Page 35]

Draft Specification      NFS version 4 Protocol              August 2002


   attributes may be accessed by using the OPENATTR operation.  The
   OPENATTR operation returns a filehandle for a virtual "attribute
   directory" and further perusal of the name space may be done using
   READDIR and LOOKUP operations on this filehandle.  Named attributes
   may then be examined or changed by normal READ and WRITE and CREATE
   operations on the filehandles returned from READDIR and LOOKUP.
   Named attributes may have attributes.

   It is recommended that servers support arbitrary named attributes.  A
   client should not depend on the ability to store any named attributes


Expires: May 2002                                              [Page 33]

Draft Specification      NFS version 4 Protocol            November 2001
   in the server's file system. filesystem.  If a server does support named
   attributes, a client which is also able to handle them should be able
   to copy a file's data and meta-data with complete transparency from
   one location to another; this would imply that names allowed for
   regular directory entries are valid for named attribute names as
   well.

   Names of attributes will not be controlled by this document or other
   IETF standards track documents.  See the section "IANA
   Considerations" for further discussion.


5.4.  Classification of Attributes

   Each of the Mandatory and Recommended attributes can be classified in
   one of three categories: per server, per filesystem, or per
   filesystem object.  Note that it is possible that some per filesystem
   attributes may vary within the filesystem.  See the "homogeneous"
   attribute for its definition.  Note that the attributes
   time_access_set and time_modify_set are not listed below because they
   are write-only attributes used in a special instance of SETATTR.

   o    The per server attribute is:

        lease_time

   o    The per filesystem attributes are:

        supp_attr, fh_expire_type, link_support, symlink_support,
        unique_handles, aclsupport, cansettime, case_insensitive,
        case_preserving, chown_restricted, files_avail, files_free,
        files_total, fs_locations, homogeneous, maxfilesize, maxname,
        maxread, maxwrite, no_trunc, space_avail, space_free,
        space_total, time_delta

   o    The per filesystem object attributes are:

        type, change, size, named_attr, fsid, rdattr_error, filehandle,
        ACL, archive, fileid, hidden, maxlink, mimetype, mode, numlinks,
        owner, owner_group, rawdev, space_used, system, time_access,
        time_backup, time_create, time_metadata, time_modify,
        mounted_on_fileid


Expires: May February 2003                                         [Page 36]

Draft Specification      NFS version 4 Protocol              August 2002


   For quota_avail_hard, quota_avail_soft, and quota_used see their
   definitions below for the appropriate classification.




















































Expires: February 2003                                         [Page 34] 37]

Draft Specification      NFS version 4 Protocol            November 2001


5.4.              August 2002


5.5.  Mandatory Attributes - Definitions


   Name              #    DataType     Access   Description
   ___________________________________________________________________
   supp_attr         0    bitmap       READ     The bit vector which
                                                would retrieve all
                                                mandatory and
                                                recommended attributes
                                                that are supported for
                                                this object.  The
                                                scope of this
                                                attribute applies to
                                                all objects with a
                                                matching fsid.

   type              1    nfs4_ftype   READ     The type of the object
                                                (file, directory,
                                                symlink)
                                                symlink, etc.)

   fh_expire_type    2    uint32       READ     Server uses this to
                                                specify filehandle
                                                expiration behavior to
                                                the client.  See the
                                                section "Filehandles"
                                                for additional
                                                description.

   change            3    uint64       READ     A value created by the
                                                server that the client
                                                can use to determine
                                                if file data,
                                                directory contents or
                                                attributes of the
                                                object have been
                                                modified.  The server
                                                may return the
                                                object's time_modify time_metadata
                                                attribute for this
                                                attribute's value but
                                                only if the file
                                                system filesystem
                                                object can not be
                                                updated more
                                                frequently than the
                                                resolution of
                                                time_modify.
                                                time_metadata.

   size              4    uint64       R/W
                                                The size of the object
                                                in bytes.

   link_support      5    bool         READ     Does the object's file
                                                system supports hard
                                                links?





Expires: May 2002 February 2003                                         [Page 35] 38]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


   link_support      5    bool         READ     True, if the object's
                                                filesystem supports
                                                hard links.

   symlink_support   6    bool         READ     Does     True, if the object's file
                                                system
                                                filesystem supports
                                                symbolic links? links.

   named_attr        7    bool         READ     Does     True, if this object have
                                                has named attributes? attributes.
                                                In other words, object
                                                has a non-empty named
                                                attribute directory.

   fsid              8    fsid4        READ     Unique file system filesystem
                                                identifier for the
                                                file system
                                                filesystem holding
                                                this object.  fsid
                                                contains major and
                                                minor components each
                                                of which are uint64.

   unique_handles    9    bool         READ     Are
                                                True, if two distinct
                                                filehandles guaranteed
                                                to refer to two
                                                different file system
                                                objects? filesystem
                                                objects.

   lease_time        10   nfs_lease4   READ     Duration of leases at
                                                server in seconds.

   rdattr_error      11   enum         READ     Error returned from
                                                getattr during
                                                readdir.

   filehandle        19   nfs_fh4      READ     The filehandle of this
                                                object (primarily for
                                                readdir requests).
















Expires: May 2002 February 2003                                         [Page 36] 39]

Draft Specification      NFS version 4 Protocol            November 2001


5.5.              August 2002


5.6.  Recommended Attributes - Definitions


 Name                #    Data Type      Access   Description
   _____________________________________________________________________
 ______________________________________________________________________
 ACL                 12   nfsace4<>      R/W      The access control
                                                  list for the object.

 aclsupport          13   uint32         READ     Indicates what types
                                                  of ACLs are supported
                                                  on the current file
                                                   system.
                                                  filesystem.

 archive             14   bool           R/W      Whether or not      True, if this file
                                                  has been archived
                                                  since the time of
                                                  last modification
                                                  (deprecated in favor
                                                  of time_backup).

 cansettime          15   bool           READ     Is     True, if the server
                                                  able to change the
                                                  times for a file system
                                                  filesystem object as
                                                  specified in a
                                                  SETATTR operation? operation.

 case_insensitive    16   bool           READ     Are     True, if filename
                                                  comparisons on this
                                                   file system
                                                  filesystem case
                                                   insensitive?
                                                  insensitive.

 case_preserving     17   bool           READ     Is     True, if filename
                                                  case on this file system
                                                   preserved?
                                                  filesystem preserved.

 chown_restricted    18   bool           READ     If TRUE, the server
                                                  will reject any
                                                  request to change
                                                  either the owner or
                                                  the group associated
                                                  with a file if the
                                                  caller is not a
                                                  privileged user (for
                                                  example, "root" in
                                                   Unix
                                                  UNIX operating
                                                  environments or in NT
                                                  Windows 2000 the
                                                  "Take Ownership"
                                                   privilege)
                                                  privilege).




Expires: May 2002 February 2003                                         [Page 37] 40]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


 fileid              20   uint64         READ     A number uniquely
                                                  identifying the file
                                                  within the file
                                                   system.
                                                  filesystem.

 files_avail         21   uint64         READ     File slots available
                                                  to this user on the
                                                   file system
                                                  filesystem containing
                                                  this object - this
                                                  should be the
                                                  smallest relevant
                                                  limit.

 files_free          22   uint64         READ     Free file slots on
                                                  the file system filesystem
                                                  containing this
                                                  object - this should
                                                  be the smallest
                                                  relevant limit.

 files_total         23   uint64         READ     Total file slots on
                                                  the file system filesystem
                                                  containing this
                                                  object.

 fs_locations        24   fs_locations   READ     Locations where this
                                                   file system
                                                  filesystem may be
                                                  found.  If the server
                                                  returns NFS4ERR_MOVED
                                                  as an error, this
                                                  attribute must MUST be
                                                  supported.

 hidden              25   bool           R/W      Is      True, if the file is
                                                  considered hidden
                                                  with respect to the WIN32
                                                  Windows API?

 homogeneous         26   bool           READ     Whether or not     True, if this
                                                  object's file system filesystem
                                                  is homogeneous, i.e.
                                                  are per file system filesystem
                                                  attributes the same
                                                  for all file system's filesystem's
                                                  objects.

 maxfilesize         27   uint64         READ     Maximum supported
                                                  file size for the
                                                   file system
                                                  filesystem of this
                                                  object.




Expires: May 2002 February 2003                                         [Page 38] 41]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


 maxlink             28   uint32         READ     Maximum number of
                                                  links for this
                                                  object.

 maxname             29   uint32         READ     Maximum filename size
                                                  supported for this
                                                  object.

 maxread             30   uint64         READ     Maximum read size
                                                  supported for this
                                                  object.

 maxwrite            31   uint64         READ
                                                  Maximum write size
                                                  supported for this
                                                  object.  This
                                                  attribute SHOULD be
                                                  supported if the file
                                                  is writable.  Lack of
                                                  this attribute can
                                                  lead to the client
                                                  either wasting
                                                  bandwidth or not
                                                  receiving the best
                                                  performance.

 mimetype            32   utf8<>         R/W      MIME body
                                                  type/subtype of this
                                                  object.

 mode                33   mode4          R/W      Unix-style      UNIX-style mode and
                                                  permission bits for
                                                  this object
                                                   (deprecated in favor
                                                   of ACLs) object.

 no_trunc            34   bool           READ     If     True, if a name
                                                  longer than name_max
                                                  is used,
                                                   will an error be
                                                  returned or will the and name be truncated? is
                                                  not truncated.

 numlinks            35   uint32         READ     Number of hard links
                                                  to this object.

 owner               36   utf8<>         R/W      The string name of
                                                  the owner of this
                                                  object.

 owner_group         37   utf8<>         R/W      The string name of
                                                  the group ownership
                                                  of this object.





Expires: May 2002 February 2003                                         [Page 39] 42]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


 quota_avail_hard    38   uint64         READ     For definition see
                                                  "Quota Attributes"
                                                  section below.

 quota_avail_soft    39   uint64         READ     For definition see
                                                  "Quota Attributes"
                                                  section below.

 quota_used          40   uint64         READ     For definition see
                                                  "Quota Attributes"
                                                  section below.

 rawdev              41   specdata4      READ     Raw device
                                                  identifier.  Unix  UNIX
                                                  device major/minor
                                                  node information.  If
                                                  the value of type is
                                                  not NF4BLK or NF4CHR,
                                                  the value return
                                                  SHOULD NOT be
                                                  considered useful.

 space_avail         42   uint64         READ     Disk space in bytes
                                                  available to this
                                                  user on the file
                                                   system
                                                  filesystem containing
                                                  this object - this
                                                  should be the
                                                  smallest relevant
                                                  limit.

 space_free          43   uint64         READ     Free disk space in
                                                  bytes on the file
                                                   system
                                                  filesystem containing
                                                  this object - this
                                                  should be the
                                                  smallest relevant
                                                  limit.

 space_total         44   uint64         READ     Total disk space in
                                                  bytes on the file
                                                   system
                                                  filesystem containing
                                                  this object.

 space_used          45   uint64         READ     Number of file system filesystem
                                                  bytes allocated to
                                                  this object.







Expires: February 2003                                         [Page 43]

Draft Specification      NFS version 4 Protocol              August 2002


 system              46   bool           R/W      Is      True, if this file is
                                                  a system "system" file with
                                                  respect to the WIN32
                                                  Windows API?

 time_access         47   nfstime4       READ     The time of last
                                                  access to the object.





Expires: May 2002                                              [Page 40]

Draft Specification      NFS version 4 Protocol            November 2001 object
                                                  by a read that was
                                                  satisfied by the
                                                  server.

 time_access_set     48   settime4       WRITE    Set the time of last
                                                  access to the object.
                                                  SETATTR use only.

 time_backup         49   nfstime4       R/W      The time of last
                                                  backup of the object.

 time_create         50   nfstime4       R/W
                                                  The time of creation
                                                  of the object. This
                                                  attribute does not
                                                  have any relation to
                                                  the traditional Unix UNIX
                                                  file attribute
                                                  "ctime" or "change
                                                  time".

 time_delta          51   nfstime4       READ     Smallest useful
                                                  server time
                                                  granularity.

 time_metadata       52   nfstime4       R/W      The time of last
                                                  meta-data
                                                  modification of the
                                                  object.

 time_modify         53   nfstime4       READ     The time of last
                                                  modification to the
                                                  object.

 time_modify_set     54   settime4       WRITE    Set the time of last
                                                  modification to the
                                                  object.  SETATTR use
                                                  only.



5.6.  Interpreting owner and owner_group


   The recommended attributes "owner" and "owner_group" are represented
   in terms of a UTF-8 string.  To avoid

 mounted_on_fileid   55   uint64         READ     Like fileid, but if
                                                  the target filehandle
                                                  is the root of a
                                                  filesystem return the
                                                  fileid of the
                                                  underlying directory.



Expires: February 2003                                         [Page 44]

Draft Specification      NFS version 4 Protocol              August 2002


5.7.  Time Access

   As defined above, the time_access attribute represents the time of
   last access to the object by a read that was satisfied by the server.
   The notion of what is an "access" depends on server's operating
   environment and/or the server's filesystem semantics.  For example,
   for servers obeying POSIX semantics, time_access would be updated
   only by the READLINK, READ, and READDIR operations and not any of the
   operations that modify the content of the object. Of course, setting
   the corresponding time_access_set attribute is another way to modify
   the time_access attribute.

   Whenever the file object resides on a writeable filesystem, the
   server should make best efforts to record time_access into stable
   storage.  However, to mitigate the performance effects of doing so,
   and most especially whenever the server is satisifying the read of
   the object's content from its cache, the server MAY cache access time
   updates and lazily write them to stable storage.  It is also
   acceptable to give administrators of the server the option to disable
   time_access updates.


5.8.  Interpreting owner and owner_group

   The recommended attributes "owner" and "owner_group" (and also users
   and groups within the "acl" attribute) are represented in terms of a
   UTF-8 string.  To avoid a representation that is tied to a particular
   underlying implementation at the client or server, the use of the
   UTF-8 string has been chosen.  Note that section 6.1 of [RFC2624]
   provides additional rationale.  It is expected that the client and
   server will have their own local representation of owner and
   owner_group that is used for local storage or presentation to the end
   user.  Therefore, it is expected that when these attributes are
   transferred between the client and server that the local
   representation is translated to a syntax of the form
   "user@dns_domain".  This will allow for a client and server that do
   not use the same local representation the ability to translate to a
   common syntax that can be interpreted by both.


Expires: May 2002                                              [Page 41]

Draft Specification      NFS version 4 Protocol            November 2001

   Similarly, security principals may be represented in different ways
   by different security mechanisms.  Servers normally translate these
   representations into a common format, generally that used by local
   storage, to serve as a means of identifying the users corresponding
   to these security principals.  When these local identifiers are
   translated to the form of the owner attribute, associated with files
   created by such principals they identify, in a common format, the
   users associated with each corresponding set of security principals.

   The translation used to interpret owner and group strings is not
   specified as part of the protocol.  This allows various solutions to
   be employed.  For example, a local translation table may be consulted
   that maps between a numeric id to the user@dns_domain syntax.  A name


Expires: February 2003                                         [Page 45]

Draft Specification      NFS version 4 Protocol              August 2002


   service may also be used to accomplish the translation.  The "dns_domain" portion  A server may
   provide a more general service, not limited by any particular
   translation (which would only translate a limited set of possible
   strings) by storing the owner
   string is meant to be and owner_group attributes in local
   storage without any translation or it may augment a DNS domain name.  For example, user@ietf.org.

   In translation
   method by storing the case where there is entire string for attributes for which no
   translation is available to the client or
   server, the attribute value must be constructed without the "@".
   Therefore, while using the absence local representation for
   those cases in which a translation is available.

   Servers that do not provide support for all possible values of the @ from the
   owner or and owner_group
   attribute signifies attributes, should return an error
   (NFS4ERR_BADOWNER) when a string is presented that has no translation was available and the
   receiver of the attribute should not place any special meaning with
   the attribute value.  Even though
   translation, as the attribute value can not be
   translated, it may still be useful.  In the case of a client, the
   attribute string may to be used set for local display a SETATTR of ownership.


5.7.  Character Case Attributes

   With respect to the case_insensitive and case_preserving attributes,
   each UCS-4 character (which UTF-8 encodes) has owner,
   owner_group, or acl attributes.  When a "long server does accept an owner
   or owner_group value as valid on a SETATTR (and similarly for the
   owner and group strings in an acl), it is promising to return that
   same string when a corresponding GETATTR is done.  Configuration
   changes and ill-constructed name translations (those that contain
   aliasing) may make that promise impossible to honor.  Servers should
   make appropriate efforts to avoid a situation in which these
   attributes have their values changed when no real change to ownership
   has occurred.

   The "dns_domain" portion of the owner string is meant to be a DNS
   domain name.  For example, user@ietf.org.  Servers should accept as
   valid a set of users for at least one domain.  A server may treat
   other domains as having no valid translations.  A more general
   service is provided when a server is capable of accepting users for
   multiple domains, or for all domains, subject to security
   constraints.

   In the case where there is no translation available to the client or
   server, the attribute value must be constructed without the "@".
   Therefore, the absence of the @ from the owner or owner_group
   attribute signifies that no translation was available at the sender
   and that the receiver of the attribute should not use that string as
   a basis for translation into its own internal format.  Even though
   the attribute value can not be translated, it may still be useful.
   In the case of a client, the attribute string may be used for local
   display of ownership.

   To provide a greater degree of compatibility with previous versions
   of NFS (i.e. v2 and v3), which identified users and groups by 32-bit
   unsigned uid's and gid's, owner and group strings that consist of
   decimal numeric values with no leading zeros can be given a special
   interpretation by clients and servers which choose to provide such
   support.  The receiver may treat such a user or group string as
   representing the same user as would be represented by a v2/v3 uid or
   gid having the corresponding numeric value.  A server is not
   obligated to accept such a string, but may return an NFS4ERR_BADOWNER
   instead.  To avoid this mechanism being used to subvert user and
   group translation, so that a client might pass all of the owners and


Expires: February 2003                                         [Page 46]

Draft Specification      NFS version 4 Protocol              August 2002


   groups in numeric form, a server SHOULD return an NFS4ERR_BADOWNER
   error when there is a valid translation for the user or owner
   designated in this way.  In that case, the client must use the
   appropriate name@domain string and not the special form for
   compatibility.

   The owner string "nobody" may be used to designate an anonymous user,
   which will be associated with a file created by a security principal
   that cannot be mapped through normal means to the owner attribute.


5.9.  Character Case Attributes

   With respect to the case_insensitive and case_preserving attributes,
   each UCS-4 character (which UTF-8 encodes) has a "long descriptive
   name" [RFC1345] which may or may not included the word "CAPITAL" or
   "SMALL".  The presence of SMALL or CAPITAL allows an NFS server to
   implement unambiguous and efficient table driven mappings for case
   insensitive comparisons, and non-case-preserving storage.  For
   general character handling and internationalization issues, see the
   section "Internationalization".


5.8.


5.10.  Quota Attributes

   For the attributes related to file system filesystem quotas, the following
   definitions apply:

   quota_avail_soft
        The value in bytes which represents the amount of additional
        disk space that can be allocated to this file or directory
        before the user may reasonably be warned.  It is understood that
        this space may be consumed by allocations to other files or
        directories though there is a rule as to which other files or
        directories.


   quota_avail_hard
        The value in bytes which represent the amount of additional disk
        space beyond the current allocation that can be allocated to
        this file or directory before further allocations will be
        refused.  It is understood that this space may be consumed by
        allocations to other files or directories.


   quota_used


Expires: May 2002                                              [Page 42]

Draft Specification      NFS version 4 Protocol            November 2001
        The value in bytes which represent the amount of disc space used
        by this file or directory and possibly a number of other similar
        files or directories, where the set of "similar" meets at least
        the criterion that allocating space to any file or directory in
        the set will reduce the "quota_avail_hard" of every other file
        or directory in the set.


Expires: February 2003                                         [Page 47]

Draft Specification      NFS version 4 Protocol              August 2002


        Note that there may be a number of distinct but overlapping sets
        of files or directories for which a quota_used value is
        maintained. E.g. "all files with a given owner", "all files with
        a given group owner". etc.

        The server is at liberty to choose any of those sets but should
        do so in a repeatable way.  The rule may be configured per-
        filesystem or may be "choose the set with the smallest quota".


5.9.


5.11.  Access Control Lists

   The NFS version 4 ACL attribute is an array of access control entries
   (ACE).  There are various access control entry types. types, as defined in
   the Section "ACE type".  The server is able to communicate which ACE
   types are supported by returning the appropriate value within the
   aclsupport attribute.  The types of ACEs
   are defined  Each ACE covers one or more operations on a
   file or directory as follows:


   Type         Description
   _____________________________________________________
   ALLOW        Explicitly grants described in the access defined in
                acemask4 to the file Section "ACE Access Mask".  It
   may also contain one or directory.

   DENY         Explicitly denies the access defined in
                acemask4 to more flags that modify the file or directory.

   AUDIT        LOG (system dependent) any access
                attempt to a file or directory which
                uses any semantics of the access methods specified
   ACE as defined in acemask4.

   ALARM        Generate a system ALARM (system
                dependent) when any access attempt is
                made to a file or directory for the
                access methods specified in acemask4. Section "ACE flag".

   The NFS ACE attribute is defined as follows:


        typedef uint32_t        acetype4;
        typedef uint32_t        aceflag4;
        typedef uint32_t        acemask4;

        struct nfsace4 {
                acetype4        type;
                aceflag4        flag;

Expires: May 2002                                              [Page 43]

Draft Specification      NFS version 4 Protocol            November 2001
                acemask4        access_mask;
                utf8string      who;
        };


   To determine if an ACCESS or OPEN a request succeeds succeeds, each nfsace4 entry is processed
   in order by the server.  Only ACEs which have a "who" that matches
   the requester are considered.  Each ACE is processed until all of the
   bits of the requester's access have been ALLOWED.  Once a bit (see
   below) has been ALLOWED by an ACCESS_ALLOWED_ACE, it is no longer
   considered in the processing of later ACEs. If an ACCESS_DENIED_ACE
   is encountered where the requester's mode access still has unALLOWED bits
   in common with the "access_mask" of the ACE, the request is denied.
   However, unlike the ALLOWED and DENIED ACE types, the ALARM and AUDIT
   ACE types do not affect a requestor's access, and instead are for
   triggering events as a result of a requestor's access attempt.
   Therefore, all AUDIT and ALARM ACEs are processed until end of the
   ACL.

   The NFS version 4 ACL model is quite rich.  Some server platforms may
   provide access control functionality that goes beyond the UNIX-style


Expires: February 2003                                         [Page 48]

Draft Specification      NFS version 4 Protocol              August 2002


   mode attribute, but which is not as rich as the NFS ACL model.  So
   that users can take advantage of this more limited functionality, the
   server may indicate that it supports ACLs as long as it follows the
   guidelines for mapping between its ACL model and the NFS version 4
   ACL model.

   The situation is complicated by the fact that a server may have
   multiple modules that enforce ACLs.  For example, the enforcement for
   NFS version 4 access may be different from the enforcement for local
   access, and both may be different from the enforcement for access
   through other protocols such as SMB.  So it may be useful for a
   server to accept an ACL even if not all of its modules are able to
   support it.

   The guiding principle in all cases is that the server must not accept
   ACLs that appear to make the file more secure than it really is.


5.11.1.  ACE type


   Type         Description
   _____________________________________________________
   ALLOW        Explicitly grants the access defined in
                acemask4 to the file or directory.

   DENY         Explicitly denies the access defined in
                acemask4 to the file or directory.

   AUDIT        LOG (system dependent) any access
                attempt to a file or directory which
                uses any of the access methods specified
                in acemask4.

   ALARM        Generate a system ALARM (system
                dependent) when any access attempt is
                made to a file or directory for the
                access methods specified in acemask4.


   A server need not support all of the above ACE types.  The bitmask
   constants used to represent the above definitions within the
   aclsupport attribute are as follows:


        const ACL4_SUPPORT_ALLOW_ACL    = 0x00000001;
        const ACL4_SUPPORT_DENY_ACL     = 0x00000002;
        const ACL4_SUPPORT_AUDIT_ACL    = 0x00000004;
        const ACL4_SUPPORT_ALARM_ACL    = 0x00000008;


5.9.1.  ACE type


   The semantics of the "type" field follow the descriptions provided


Expires: February 2003                                         [Page 49]

Draft Specification      NFS version 4 Protocol              August 2002


   above.

   The bitmask constants used for the type field (acetype4) are as follows:


        const ACE4_ACCESS_ALLOWED_ACE_TYPE      = 0x00000000;
        const ACE4_ACCESS_DENIED_ACE_TYPE       = 0x00000001;
        const ACE4_SYSTEM_AUDIT_ACE_TYPE        = 0x00000002;
        const ACE4_SYSTEM_ALARM_ACE_TYPE        = 0x00000003;


5.9.2.  ACE flag

   The "flag" field contains values based on the following descriptions.


   ACE4_FILE_INHERIT_ACE

   Can be placed on a directory and indicates that this ACE


   Clients should be
   added not attempt to each new non-directory file created.


   ACE4_DIRECTORY_INHERIT_ACE

   Can be placed on a directory and indicates set an ACE unless the server claims
   support for that this ACE should be
   added to each new directory created.



Expires: May 2002                                              [Page 44]

Draft Specification      NFS version 4 Protocol            November 2001


   ACE4_INHERIT_ONLY_ACE

   Can be placed on type.  If the server receives a directory but does not apply request to set
   an ACE that it cannot store, it must reject the directory,
   only to newly created files/directories as specified by request with
   NFS4ERR_ATTRNOTSUPP.

   If the above two
   flags.


   ACE4_NO_PROPAGATE_INHERIT_ACE

   Can be placed on a directory. Normally when server receives a new directory is
   created and request to set an ACE exists on that it can store but
   cannot enforce, the parent directory which is marked
   ACL4_DIRECTORY_INHERIT_ACE, two ACEs are placed on server SHOULD reject the new directory.
   One request.

   Example: suppose a server can enforce NFS ACLs for the directory itself and one which is an inheritable ACE NFS access but
   cannot enforce ACLs for
   newly created directories.  This flag tells the server to not place
   an ACE local access.  If arbitrary processes can run
   on the newly created directory which is inheritable by
   subdirectories of server, then the created directory.


   ACE4_SUCCESSFUL_ACCESS_ACE_FLAG

   ACL4_FAILED_ACCESS_ACE_FLAG

   Both server SHOULD NOT indicate for AUDIT and ALARM which state to log the event.  On
   every ACCESS or OPEN call which occurs on a file or directory which
   has an ACL that is of type ACE4_SYSTEM_AUDIT_ACE_TYPE or
   ACE4_SYSTEM_ALARM_ACE_TYPE, the attempted access is compared to the
   ace4mask of these ACLs. If the access is a subset of ace4mask and the
   identifier match, an AUDIT trail or an ALARM is generated.  By
   default this happens regardless of the success or failure of the
   ACCESS or OPEN call.

   The flag ACE4_SUCCESSFUL_ACCESS_ACE_FLAG only produces the AUDIT or
   ALARM if the ACCESS or OPEN call is successful. The
   ACE4_FAILED_ACCESS_ACE_FLAG causes support.  On
   the ALARM or AUDIT other hand, if only trusted administrative programs run locally,
   then the ACCESS
   or OPEN call fails.


   ACE4_IDENTIFIER_GROUP

   Indicates that the "who" refers to a GROUP as defined under Unix.



   The bitmask constants used for the flag field are as follows:

   const ACE4_FILE_INHERIT_ACE             = 0x00000001;
   const ACE4_DIRECTORY_INHERIT_ACE        = 0x00000002;
   const ACE4_NO_PROPAGATE_INHERIT_ACE     = 0x00000004;
   const ACE4_INHERIT_ONLY_ACE             = 0x00000008;
   const ACE4_SUCCESSFUL_ACCESS_ACE_FLAG   = 0x00000010;
   const ACE4_FAILED_ACCESS_ACE_FLAG       = 0x00000020;
   const ACE4_IDENTIFIER_GROUP             = 0x00000040;


Expires: May 2002                                              [Page 45]

Draft Specification      NFS version 4 Protocol            November 2001


5.9.3. server may indicate ACL support.


5.11.2.  ACE Access Mask

   The access_mask field contains values based on the following:


   Access                 Description
   _______________________________________________________________
   READ_DATA              Permission to read the data of the file
   LIST_DIRECTORY         Permission to list the contents of a
                          directory
   WRITE_DATA             Permission to modify the file's data
   ADD_FILE               Permission to add a new file to a
                          directory
   APPEND_DATA            Permission to append data to a file
   ADD_SUBDIRECTORY       Permission to create a subdirectory to a
                          directory
   READ_NAMED_ATTRS       Permission to read the named attributes
                          of a file
   WRITE_NAMED_ATTRS      Permission to write the named attributes
                          of a file
   EXECUTE                Permission to execute a file
   DELETE_CHILD           Permission to delete a file or directory
                          within a directory
   READ_ATTRIBUTES        The ability to read basic attributes
                          (non-acls) of a file



Expires: February 2003                                         [Page 50]

Draft Specification      NFS version 4 Protocol              August 2002


   WRITE_ATTRIBUTES       Permission to change basic attributes
                          (non-acls) of a file

   DELETE                 Permission to Delete the file
   READ_ACL               Permission to Read the ACL
   WRITE_ACL              Permission to Write the ACL
   WRITE_OWNER            Permission to change the owner
   SYNCHRONIZE            Permission to access file locally at the
                          server with synchronous reads and writes


   The bitmask constants used for the access mask field are as follows:

   const ACE4_READ_DATA            = 0x00000001;
   const ACE4_LIST_DIRECTORY       = 0x00000001;
   const ACE4_WRITE_DATA           = 0x00000002;
   const ACE4_ADD_FILE             = 0x00000002;
   const ACE4_APPEND_DATA          = 0x00000004;
   const ACE4_ADD_SUBDIRECTORY     = 0x00000004;
   const ACE4_READ_NAMED_ATTRS     = 0x00000008;
   const ACE4_WRITE_NAMED_ATTRS    = 0x00000010;
   const ACE4_EXECUTE              = 0x00000020;
   const ACE4_DELETE_CHILD         = 0x00000040;
   const ACE4_READ_ATTRIBUTES      = 0x00000080;
   const ACE4_WRITE_ATTRIBUTES     = 0x00000100;
   const ACE4_DELETE               = 0x00010000;
   const ACE4_READ_ACL             = 0x00020000;

Expires: May 2002                                              [Page 46]

Draft Specification      NFS version 4 Protocol            November 2001
   const ACE4_WRITE_ACL            = 0x00040000;
   const ACE4_WRITE_OWNER          = 0x00080000;
   const ACE4_SYNCHRONIZE          = 0x00100000;


5.9.4.  ACE who


   There are several special identifiers ("who") which

   Server implementations need to be
   understood universally. Some of these identifiers cannot be
   understood when an NFS client accesses not provide the server, but have meaning
   when granularity of control
   that is implied by this list of masks.  For example, POSIX-based
   systems might not distinguish APPEND_DATA (the ability to append to a local process accesses the file. The
   file) from WRITE_DATA (the ability to display and modify these permissions is permitted over NFS.


   Who                    Description
   _______________________________________________________________
   "OWNER"                The owner of the file.
   "GROUP"                The group associated with the file.
   "EVERYONE"             The world.
   "INTERACTIVE"          Accessed from an interactive terminal.
   "NETWORK"              Accessed via the network.
   "DIALUP"               Accessed as existing contents); both
   masks would be tied to a dialup user single ``write'' permission.  When such a
   server returns attributes to the server.
   "BATCH"                Accessed from client, it would show both
   APPEND_DATA and WRITE_DATA if and only if the write permission is
   enabled.

   If a batch job.
   "ANONYMOUS"            Accessed without any authentication.
   "AUTHENTICATED"        Any authenticated user (opposite of
                          ANONYMOUS)
   "SERVICE"              Access from server receives a system service.

   To avoid conflict, these special identifiers are distinguish by an
   appended "@" and SETATTR request that it cannot accurately
   implement, it should appear error in the form "xxxx@" (note: no domain
   name after the "@"). direction of more restricted
   access.  For example: ANONYMOUS@.






















Expires: May 2002 example, suppose a server cannot distinguish overwriting
   data from appending new data, as described in the previous paragraph.
   If a client submits an ACE where APPEND_DATA is set but WRITE_DATA is
   not (or vice versa), the server should reject the request with
   NFS4ERR_ATTRNOTSUPP.  Nonetheless, if the ACE has type DENY, the
   server may silently turn on the other bit, so that both APPEND_DATA
   and WRITE_DATA are denied.





Expires: February 2003                                         [Page 47] 51]

Draft Specification      NFS version 4 Protocol            November 2001


6.  File System Migration and Replication

   With the use of the recommended attribute "fs_locations",              August 2002


5.11.3.  ACE flag

   The "flag" field contains values based on the NFS
   version 4 server has following descriptions.


   ACE4_FILE_INHERIT_ACE

   Can be placed on a method of providing file system migration or
   replication services.  For the purposes of migration directory and replication,
   a indicates that this ACE should be
   added to each new non-directory file system will created.


   ACE4_DIRECTORY_INHERIT_ACE

   Can be defined as all files that share placed on a given fsid
   (both major directory and minor values are the same).

   The fs_locations attribute provides indicates that this ACE should be
   added to each new directory created.


   ACE4_INHERIT_ONLY_ACE

   Can be placed on a list of file system locations.
   These locations are directory but does not apply to the directory,
   only to newly created files/directories as specified by providing the server name (either
   DNS domain or IP address) above two
   flags.


   ACE4_NO_PROPAGATE_INHERIT_ACE

   Can be placed on a directory. Normally when a new directory is
   created and the path name representing the root of
   the file system.  Depending an ACE exists on the type of service being provided, parent directory which is marked
   ACL4_DIRECTORY_INHERIT_ACE, two ACEs are placed on the list will provide a new location or a set of alternate locations directory.
   One for the file system.  The client will use this information to
   redirect its requests directory itself and one which is an inheritable ACE for
   newly created directories.  This flag tells the server to not place
   an ACE on the new server.


6.1.  Replication

   It newly created directory which is expected that file system replication will be used in the case inheritable by
   subdirectories of read-only data.  Typically, the file system will be replicated on
   two or more servers. created directory.


   ACE4_SUCCESSFUL_ACCESS_ACE_FLAG

   ACL4_FAILED_ACCESS_ACE_FLAG

   The fs_locations attribute will provide the
   list of these locations ACE4_SUCCESSFUL_ACCESS_ACE_FLAG (SUCCESS) and
   ACE4_FAILED_ACCESS_ACE_FLAG (FAILED) flag bits relate only to
   ACE4_SYSTEM_AUDIT_ACE_TYPE (AUDIT) and ACE4_SYSTEM_ALARM_ACE_TYPE
   (ALARM) ACE types. If during the client.  On first access processing of the file
   system, file's ACL, the client should obtain
   server encounters an AUDIT or ALARM ACE that matches the value principal
   attempting the OPEN, the server notes that fact, and the prescence,
   if any, of the fs_locations
   attribute.  If, SUCCESS and FAILED flags encountered in the future, the client finds AUDIT or
   ALARM ACE. Once the server
   unresponsive, completes the client may attempt to use another server specified
   by fs_locations.

   If applicable, ACL processing, and the client must take
   share reservation processing, and the appropriate steps to recover
   valid filehandles from OPEN call, it then notes if the new server.  This is described in more
   detail in
   OPEN succeeded or failed. If the following sections.


6.2.  Migration

   File system migration is used to move a file system from one server
   to another.  Migration is typically used for a file system that is
   writable OPEN succeeded, and has a single copy.  The expected use of migration is if the SUCCESS
   flag was set for
   load balancing a matching AUDIT or general resource reallocation.  The protocol does
   not specify how ALARM, then the file system will be moved between servers.  This
   server-to-server transfer mechanism is left to the server
   implementor.  However, the method used to communicate the migration appropriate
   AUDIT or ALARM event between client and server is specified here.

   Once the servers participating in the migration have completed the
   move of the file system, occurs. If the error NFS4ERR_MOVED will be returned for
   subsequent requests received by OPEN failed, and if the original server.  The
   NFS4ERR_MOVED error is returned FAILED
   flag was set for all operations except GETATTR.
   Upon receiving the NFS4ERR_MOVED error, the client will obtain the
   value of the fs_locations attribute.  The client will matching AUDIT or ALARM, then use the
   contents of the attribute to redirect its requests to the specified
   server.  To facilitate the use of GETATTR, operations such as PUTFH appropriate


Expires: May 2002 February 2003                                         [Page 48] 52]

Draft Specification      NFS version 4 Protocol            November 2001


   must also be accepted by              August 2002


   AUDIT or ALARM event occurs.  Clearly either or both of the server for SUCCESS
   or FAILED can be set, but if neither is set, the migrated file system's
   filehandles.  Note AUDIT or ALARM ACE
   is not useful.

   The previously described processing applies to that if of the server ACCESS
   operation as well.  The difference being that "success" or "failure"
   does not mean whether ACCESS returns NFS4ERR_MOVED, NFS4_OK or not.  Success means
   whether ACCESS returns all requested and supported bits.  Failure
   means whether ACCESS failed to return a bit that was requested and
   supported.


   ACE4_IDENTIFIER_GROUP

   Indicates that the "who" refers to a GROUP as defined under UNIX.



   The bitmask constants used for the flag field are as follows:

   const ACE4_FILE_INHERIT_ACE             = 0x00000001;
   const ACE4_DIRECTORY_INHERIT_ACE        = 0x00000002;
   const ACE4_NO_PROPAGATE_INHERIT_ACE     = 0x00000004;
   const ACE4_INHERIT_ONLY_ACE             = 0x00000008;
   const ACE4_SUCCESSFUL_ACCESS_ACE_FLAG   = 0x00000010;
   const ACE4_FAILED_ACCESS_ACE_FLAG       = 0x00000020;
   const ACE4_IDENTIFIER_GROUP             = 0x00000040;

   A server MUST need not support the fs_locations attribute. any of these flags.  If the client requests more attributes than just fs_locations, the server supports
   flags that are similar to, but not exactly the same as, these flags,
   the implementation may return fs_locations only.  This is to be expected since define a mapping between the server has migrated protocol-defined
   flags and the implementation-defined flags.  Again, the guiding
   principle is that the file system and may not have a method of
   obtaining additional attribute data.

   The server implementor needs appear to be careful in developing more secure than it
   really is.

   For example, suppose a migration
   solution.  The client tries to set an ACE with
   ACE4_FILE_INHERIT_ACE set but not ACE4_DIRECTORY_INHERIT_ACE.  If the
   server must consider all does not support any form of ACL inheritance, the state information
   clients may have outstanding at the server.  This includes but is not
   limited to locking/share state, delegation state, and asynchronous
   file writes which are represented by WRITE and COMMIT verifiers.  The server
   should strive to minimize reject the impact on its clients during request with NFS4ERR_ATTRNOTSUPP.  If the server
   supports a single "inherit ACE" flag that applies to both files and
   after
   directories, the migration process.


6.3.  Interpretation of server may reject the fs_locations Attribute

   The fs_location attribute is structured in request (i.e., requiring the following way:

   struct fs_location {
           utf8string      server<>;
           pathname4       rootpath;
   };

   struct fs_locations {
           pathname4       fs_root;
           fs_location     locations<>;
   };

   The fs_location struct is used
   client to represent set both the location of a file
   system by providing a and directory inheritance flags).  The
   server name may also accept the request and silently turn on the path
   ACE4_DIRECTORY_INHERIT_ACE flag.


5.11.4.  ACE who

   There are several special identifiers ("who") which need to be
   understood universally, rather than in the root context of the
   file system.  For a multi-homed server or a set of servers that use
   the same rootpath, an array particular
   DNS domain. Some of server names may these identifiers cannot be provided.  An
   entry in the server array is understood when an UTF8 string and represents one of a
   traditional DNS host name, IPv4 address, or IPv6 address.  It is not
   NFS client accesses the server, but have meaning when a requirement that all servers that share local process


Expires: February 2003                                         [Page 53]

Draft Specification      NFS version 4 Protocol              August 2002


   accesses the same rootpath be listed
   in one fs_location struct. file. The array of server names ability to display and modify these
   permissions is provided for
   convenience.  Servers that share permitted over NFS, even if none of the same rootpath may also be listed
   in separate fs_location entries in access methods
   on the fs_locations attribute. server understands the identifiers.


   Who                    Description
   _______________________________________________________________
   "OWNER"                The fs_locations struct and attribute then contains an array owner of
   locations.  Since the name space of each server may be constructed
   differently, file.
   "GROUP"                The group associated with the "fs_root" field is provided. file.
   "EVERYONE"             The path represented
   by fs_root represents world.
   "INTERACTIVE"          Accessed from an interactive terminal.
   "NETWORK"              Accessed via the location of network.
   "DIALUP"               Accessed as a dialup user to the file server.
   "BATCH"                Accessed from a batch job.
   "ANONYMOUS"            Accessed without any authentication.
   "AUTHENTICATED"        Any authenticated user (opposite of
                          ANONYMOUS)
   "SERVICE"              Access from a system service.

   To avoid conflict, these special identifiers are distinguish by an
   appended "@" and should appear in the server's form "xxxx@" (note: no domain
   name space.  Therefore, after the fs_root path "@").  For example: ANONYMOUS@.


5.11.5.  Mode Attribute

   The NFS version 4 mode attribute is only associated with the
   server from which based on the fs_locations attribute was obtained. UNIX mode bits. The
   fs_root path is meant
   following bits are defined:


        const MODE4_SUID = 0x800;  /* set user id on execution */
        const MODE4_SGID = 0x400;  /* set group id on execution */
        const MODE4_SVTX = 0x200;  /* save text even after use */
        const MODE4_RUSR = 0x100;  /* read permission: owner */
        const MODE4_WUSR = 0x080;  /* write permission: owner */
        const MODE4_XUSR = 0x040;  /* execute permission: owner */
        const MODE4_RGRP = 0x020;  /* read permission: group */
        const MODE4_WGRP = 0x010;  /* write permission: group */
        const MODE4_XGRP = 0x008;  /* execute permission: group */
        const MODE4_ROTH = 0x004;  /* read permission: other */
        const MODE4_WOTH = 0x002;  /* write permission: other */
        const MODE4_XOTH = 0x001;  /* execute permission: other */


   Bits MODE4_RUSR, MODE4_WUSR, and MODE4_XUSR apply to aid the client principal
   identified in locating the file system
   at owner attribute.  Bits MODE4_RGRP, MODE4_WGRP, and
   MODE4_XGRP apply to the various servers listed. principals identified in the owner_group
   attribute.  Bits MODE4_ROTH, MODE4_WOTH, MODE4_XOTH apply to any
   principal that does not match that in the owner group, and does not
   have a group matching that of the owner_group attribute.

   The remaining bits are not defined by this protocol and MUST NOT be


Expires: May 2002 February 2003                                         [Page 49] 54]

Draft Specification      NFS version 4 Protocol            November 2001


   As an example, there is              August 2002


   used.  The minor version mechanism must be used to define further bit
   usage.

   Note that in UNIX, if a replicated file system located at two
   servers (servA and servB).  At servA has the MODE4_SGID bit set and no
   MODE4_XGRP bit set, then READ and WRITE must use mandatory file system is located at
   path "/a/b/c".  At servB
   locking.

5.11.6.  Mode and ACL Attribute

   The server that supports both mode and ACL must take care to
   synchronize the file system is located at path "/x/y/z".
   In this example the client accesses the file system first at servA MODE4_*USR, MODE4_*GRP, and MODE4_*OTH bits with a multi-component lookup path the
   ACEs which have respective who fields of "/a/b/c/d".  Since "OWNER@", "GROUP@", and
   "EVERYONE@" so that the client
   used a multi-component lookup to obtain can see semantically equivalent access
   permissions exist whether the filehandle at "/a/b/c/d",
   it is unaware that client asks for owner, owner_group and
   mode attributes, or for just the file system's root is located in servA's name
   space at "/a/b/c".  When ACL.

   Because the client switches to servB, it will need
   to determine mode attribute includes bits (e.g. MODE4_SVTX) that the directory have
   nothing to do with ACL semantics, it first referenced at servA is now
   represented by the path "/x/y/z/d" on servB.  To facilitate this, permitted for clients to
   specify both the
   fs_locations ACL attribute provided by servA would have a fs_root value
   of "/a/b/c" and two entries in fs_location.  One entry mode in fs_location
   will be for itself (servA) and the other will be same SETATTR
   operation. However, because there is no prescribed order for servB with
   processing the attributes in a
   path of "/x/y/z".  With this information, SETATTR, the client is able to
   substitute "/x/y/z" for the "/a/b/c" at must ensure that
   ACL attribute, if specified without mode, would produce the beginning of its access
   path desired
   mode bits, and construct "/x/y/z/d" to use for the new server.


6.4.  Filehandle Recovery for Migration or Replication

   Filehandles for file systems that are replicated or migrated
   generally have conversely, the same semantics as for file systems that are not
   replicated or migrated.  For example, mode attribute if a file system has persistent
   filehandles and it is migrated to another server, specified without
   ACL, would produce the filehandle
   values for desired "OWNER@", "GROUP@", and "EVERYONE@"
   ACEs.


5.11.7.  mounted_on_fileid

   UNIX-based operating environments connect a filesystem into the file system will be valid at
   namespace by connecting (mounting) the new server.

   For volatile filehandles, filesystem onto the servers involved likely do not have a
   mechanism to transfer filehandle format and content between
   themselves.  Therefore, a server may have difficulty in determining
   if existing
   file object (the mount point, usually a volatile filehandle from an old server should return an error directory) of
   NFS4ERR_FHEXPIRED.  Therefore, an existing
   filesystem. When the client mount point's parent directory is informed, with read via an
   API like readdir(), the use return results are directory entries, each
   with a component name and a fileid. The fileid of the fh_expire_type attribute, whether volatile filehandles mount point's
   directory entry will
   expire at be different from the migration or replication event.  If fileid that the bit
   FH4_VOL_MIGRATION stat()
   system call returns. The stat() system call is set in returning the fh_expire_type attribute, fileid
   of the client
   must treat root of the volatile filehandle as if mounted filesystem, whereas readdir() is returning
   the server had fileid stat() would have returned before any filesystems were
   mounted on the
   NFS4ERR_FHEXPIRED error.  At mount point.

   Unlike NFS version 3, NFS version 4 allows a client's LOOKUP request
   to cross other filesystems. The client detects the migration or replication event in filesystem
   crossing whenever the presence filehandle argument of LOOKUP has an fsid
   attribute different from that of the FH4_VOL_MIGRATION bit, the filehandle returned by LOOKUP. A
   UNIX-based client will not
   present the original or old volatile file handle consider this a "mount point crossing".  UNIX
   has a legacy scheme for allowing a process to determine its current
   working directory. This relies on readdir() of a mount point's parent
   and stat() of the new server. mount point returning fileids as previously
   described.  The client will start its communication with mounted_on_fileid attribute corresponds to the new server by
   recovering its filehandles using the saved file names. fileid
   that readdir() would have returned as described previously.



Expires: May 2002 February 2003                                         [Page 50] 55]

Draft Specification      NFS version 4 Protocol            November 2001


7.              August 2002


   While the NFS Server Name Space


7.1.  Server Exports

   On version 4 client could simply fabricate a UNIX server fileid
   corresponding to what mounted_on_fileid provides (and if the name space describes all server
   does not support mounted_on_fileid, the files reachable by
   pathnames under client has no choice), there
   is a risk that the root directory or "/".  On client will generate a Windows NT server fileid that conflicts with
   one that is already assigned to another object in the name space constitutes all filesystem.
   Instead, if the files on disks named by mapped
   disk letters.  NFS server administrators rarely make the entire
   server's file system name space available to NFS clients.  More often
   portions of the name space are made available via an "export"
   feature.  In previous versions of can provide the NFS protocol, mounted_on_fileid, the root
   filehandle
   potential for each export client operational problems in this area is obtained through the MOUNT protocol; eliminated.

   If the client sends a string server detects that identifies there is no mounted point at the export of name space
   and target
   file object, then the server value for mounted_on_fileid that it returns is
   the root filehandle for it.  The MOUNT
   protocol supports an EXPORTS procedure same as that will enumerate of the
   server's exports.


7.2.  Browsing Exports fileid attribute.

   The NFS version 4 protocol provides a root filehandle that clients
   can use to obtain filehandles mounted_on_fileid attribute is RECOMMENDED, so the server SHOULD
   provide it if possible, and for these exports via a multi-component
   LOOKUP.  A common user experience UNIX-based server, this is
   straightforward. Usually, mounted_on_fileid will be requested during
   a READDIR operation, in which case it is trivial (at least for UNIX-
   based servers) to use return mounted_on_fileid since it is equal to the
   fileid of a graphical user
   interface (perhaps directory entry returned by readdir().  If
   mounted_on_fileid is requested in a file "Open" dialog window) to find GETATTR operation, the server
   should obey an invariant that has it returning a value that is equal
   to the file via
   progressive browsing through object's entry in the object's parent directory, i.e.
   what readdir() would have returned.  Some operating environments
   allow a directory tree.  The client must series of two or more filesystems to be
   able mounted onto a single
   mount point. In this case, for the server to move from one export obey the aforementioned
   invariant, it will need to another export via single-component,
   progressive LOOKUP operations.

   This style of browsing is find the base mount point, and not well supported by the
   intermediate mount points.




























Expires: February 2003                                         [Page 56]

Draft Specification      NFS version 2 4 Protocol              August 2002


6.  Filesystem Migration and
   3 protocols.  The client expects all LOOKUP operations to remain
   within a single Replication

   With the use of the recommended attribute "fs_locations", the NFS
   version 4 server file system. has a method of providing filesystem migration or
   replication services.  For example, the device
   attribute will not change.  This prevents purposes of migration and replication,
   a client from taking name
   space paths filesystem will be defined as all files that span exports.

   An automounter on share a given fsid
   (both major and minor values are the client can obtain same).

   The fs_locations attribute provides a snapshot list of filesystem locations.
   These locations are specified by providing the server's server name space using (either
   DNS domain or IP address) and the EXPORTS procedure path name representing the root of
   the MOUNT protocol.  If it
   understands filesystem.  Depending on the server's pathname syntax, it can create an image type of service being provided, the server's name space
   list will provide a new location or a set of alternate locations for
   the filesystem.  The client will use this information to redirect its
   requests to the new server.


6.1.  Replication

   It is expected that filesystem replication will be used in the case
   of read-only data.  Typically, the filesystem will be replicated on
   two or more servers.  The fs_locations attribute will provide the
   list of these locations to the client.  The parts  On first access of the name space
   that are not exported by
   filesystem, the client should obtain the value of the fs_locations
   attribute.  If, in the future, the client finds the server are filled
   unresponsive, the client may attempt to use another server specified
   by fs_locations.

   If applicable, the client must take the appropriate steps to recover
   valid filehandles from the new server.  This is described in more
   detail in with a "pseudo file
   system" that allows the user following sections.


6.2.  Migration

   Filesystem migration is used to browse move a filesystem from one mounted file system server to
   another.  There  Migration is typically used for a drawback to this representation filesystem that is
   writable and has a single copy.  The expected use of migration is for
   load balancing or general resource reallocation.  The protocol does
   not specify how the
   server's name space on the client: it filesystem will be moved between servers.  This
   server-to-server transfer mechanism is static.  If left to the server
   administrator adds a new export
   implementor.  However, the method used to communicate the migration
   event between client and server is specified here.

   Once the servers participating in the migration have completed the
   move of the filesystem, the error NFS4ERR_MOVED will be unaware of it.


7.3.  Server Pseudo File System

   NFS version 4 servers avoid this name space inconsistency returned for
   subsequent requests received by
   presenting the original server.  The
   NFS4ERR_MOVED error is returned for all operations except PUTFH and
   GETATTR.  Upon receiving the exports within NFS4ERR_MOVED error, the framework client will
   obtain the value of a single server
   name space.  An NFS version 4 the fs_locations attribute.  The client uses LOOKUP and READDIR
   operations will then
   use the contents of the attribute to browse seamlessly from one export redirect its requests to another.  Portions the
   specified server.  To facilitate the use of GETATTR, operations such


Expires: May 2002 February 2003                                         [Page 51] 57]

Draft Specification      NFS version 4 Protocol            November 2001


   of              August 2002


   as PUTFH must also be accepted by the server name space that are not exported are bridged via a
   "pseudo for the migrated file system"
   system's filehandles.  Note that provides a view of exported directories if the server returns NFS4ERR_MOVED,
   the server MUST support the fs_locations attribute.

   If the client requests more attributes than just fs_locations, the
   server may return fs_locations only.  A pseudo file system  This is to be expected since
   the server has a unique fsid migrated the filesystem and behaves like may not have a
   normal, read only file system.

   Based on the construction method of
   obtaining additional attribute data.

   The server implementor needs to be careful in developing a migration
   solution.  The server must consider all of the server's name space, it is possible
   that multiple pseudo file systems state information
   clients may exist.  For example,

   /a         pseudo file system
   /a/b       real file system
   /a/b/c     pseudo file system
   /a/b/c/d   real file system

   Each of have outstanding at the pseudo server.  This includes but is not
   limited to locking/share state, delegation state, and asynchronous
   file systems writes which are consider separate entities represented by WRITE and
   therefore will have a unique fsid.


7.4.  Multiple Roots COMMIT verifiers.  The DOS
   server should strive to minimize the impact on its clients during and Windows operating environments are sometimes described as
   having "multiple roots".  File systems are commonly represented as
   disk letters.  MacOS represents file systems as top level names.  NFS
   version 4 servers for these platforms can construct a pseudo file
   system above these root names so that disk letters or volume names
   are simply directory names in
   after the pseudo root.


7.5.  Filehandle Volatility

   The nature migration process.


6.3.  Interpretation of the server's pseudo file system fs_locations Attribute

   The fs_location attribute is that it structured in the following way:

   struct fs_location {
           utf8string      server<>;
           pathname4       rootpath;
   };

   struct fs_locations {
           pathname4       fs_root;
           fs_location     locations<>;
   };

   The fs_location struct is used to represent the location of a logical
   representation
   filesystem by providing a server name and the path to the root of file system(s) available from the server.
   Therefore,
   filesystem.  For a multi-homed server or a set of servers that use
   the pseudo file system is most likely constructed
   dynamically when same rootpath, an array of server names may be provided.  An
   entry in the server array is first instantiated. an UTF8 string and represents one of a
   traditional DNS host name, IPv4 address, or IPv6 address.  It is expected not
   a requirement that all servers that share the pseudo file system may not have an on disk counterpart from
   which persistent filehandles could same rootpath be constructed.  Even though it listed
   in one fs_location struct.  The array of server names is
   preferable provided for
   convenience.  Servers that share the server provide persistent filehandles for same rootpath may also be listed
   in separate fs_location entries in the
   pseudo file system, fs_locations attribute.

   The fs_locations struct and attribute then contains an array of
   locations.  Since the NFS client should expect that pseudo file
   system filehandles are volatile.  This can name space of each server may be confirmed constructed
   differently, the "fs_root" field is provided.  The path represented
   by checking fs_root represents the associated "fh_expire_type" attribute for those filehandles location of the filesystem in
   question.  If the filehandles are volatile, server's
   name space.  Therefore, the NFS client must be
   prepared to recover a filehandle value (e.g. fs_root path is only associated with a multi-component
   LOOKUP) when receiving an error of NFS4ERR_FHEXPIRED.


7.6.  Exported Root

   If the server's root file system is exported, one might conclude that
   a pseudo-file system
   server from which the fs_locations attribute was obtained.  The
   fs_root path is not needed.  This would be wrong.  Assume meant to aid the
   following file systems on a server:

           /       disk1  (exported)
           /a      disk2  (not exported) client in locating the filesystem at
   the various servers listed.



Expires: May 2002 February 2003                                         [Page 52] 58]

Draft Specification      NFS version 4 Protocol            November 2001


           /a/b    disk3  (exported)

   Because disk2              August 2002


   As an example, there is not exported, disk3 cannot be reached with simple
   LOOKUPs.  The server must bridge the gap with a pseudo-file system.


7.7.  Mount Point Crossing

   The server file system environment may be constructed in such a way
   that one file system contains a directory which is 'covered' or
   mounted upon by a second file system.  For example:

           /a/b            (file system 1)
           /a/b/c/d        (file system 2)

   The pseudo file system for this server may be constructed to look
   like:

           /               (place holder/not exported)
           /a/b            (file system 1)
           /a/b/c/d        (file system 2)

   It is the server's responsibility to present replicated filesystem located at two
   servers (servA and servB).  At servA the pseudo file system
   that filesystem is complete to located at
   path "/a/b/c".  At servB the client.  If filesystem is located at path "/x/y/z".
   In this example the client sends accesses the filesystem first at servA
   with a multi-component lookup request
   for the path "/a/b/c/d", the server's response is the filehandle of
   the file system "/a/b/c/d".  In previous versions of  Since the NFS
   protocol, client
   used a multi-component lookup to obtain the server would respond with filehandle at "/a/b/c/d",
   it is unaware that the directory "/a/b/c/d"
   within filesystem's root is located in servA's name
   space at "/a/b/c".  When the file system "/a/b".

   The NFS client switches to servB, it will be able need
   to determine if that the directory it crosses a server mount
   point first referenced at servA is now
   represented by a change in the path "/x/y/z/d" on servB.  To facilitate this, the
   fs_locations attribute provided by servA would have a fs_root value
   of the "fsid" attribute.


7.8.  Security Policy "/a/b/c" and two entries in fs_location.  One entry in fs_location
   will be for itself (servA) and Name Space Presentation

   The application of the server's security policy needs to other will be carefully
   considered by for servB with a
   path of "/x/y/z".  With this information, the implementor.  One may choose client is able to limit
   substitute "/x/y/z" for the
   viewability of portions "/a/b/c" at the beginning of its access
   path and construct "/x/y/z/d" to use for the pseudo file system based on new server.

   See the
   server's perception of section "Security Considerations" for a discussion on the client's ability to authenticate itself
   properly.  However, with
   recommendations for the support of multiple security mechanisms
   and the ability flavor to negotiate be used by any GETATTR
   operation that requests the appropriate use of these mechanisms, "fs_locations" attribute.


6.4.  Filehandle Recovery for Migration or Replication

   Filehandles for filesystems that are replicated or migrated generally
   have the server is unable to properly determine same semantics as for filesystems that are not replicated or
   migrated.  For example, if a client will be able filesystem has persistent filehandles
   and it is migrated to authenticate itself.  If, based on its policies, another server, the server
   chooses to limit filehandle values for the contents of
   filesystem will be valid at the pseudo file system, new server.

   For volatile filehandles, the server
   may effectively hide file systems from servers involved likely do not have a client that
   mechanism to transfer filehandle format and content between
   themselves.  Therefore, a server may otherwise have legitimate access.








Expires: May 2002                                              [Page 53]

Draft Specification      NFS version 4 Protocol            November 2001


8.  File Locking and Share Reservations

   Integrating locking into difficulty in determining
   if a volatile filehandle from an old server should return an error of
   NFS4ERR_FHEXPIRED.  Therefore, the NFS protocol necessarily causes it to be
   state-full.  With client is informed, with the inclusion use
   of "share" file locks the protocol
   becomes substantially more dependent on state than fh_expire_type attribute, whether volatile filehandles will
   expire at the traditional
   combination of NFS and NLM [XNFS].  There are three components to
   making this state manageable:

   o    Clear division between client and server

   o    Ability to reliably detect inconsistency migration or replication event.  If the bit
   FH4_VOL_MIGRATION is set in state between client
        and server

   o    Simple and robust recovery mechanisms

   In this model, the server owns fh_expire_type attribute, the state information.  The client
   communicates its view of this state to
   must treat the server volatile filehandle as needed.  The
   client is also able to detect inconsistent state before modifying a
   file.

   To support Win32 "share" locks it is necessary to atomically OPEN if the server had returned the
   NFS4ERR_FHEXPIRED error.  At the migration or
   CREATE files.  Having a separate share/unshare operation would not
   allow correct implementation replication event in
   the presence of the Win32 OpenFile API.  In order to
   correctly implement share semantics, FH4_VOL_MIGRATION bit, the previous NFS protocol
   mechanisms used when a file is opened client will not
   present the original or created (LOOKUP, CREATE,
   ACCESS) need old volatile filehandle to be replaced. the new server.
   The client will start its communication with the new server by
   recovering its filehandles using the saved file names.










Expires: February 2003                                         [Page 59]

Draft Specification      NFS version 4 protocol has an OPEN
   operation that subsumes the functionality of LOOKUP, CREATE, and
   ACCESS.  However, because many operations require Protocol              August 2002


7.  NFS Server Name Space


7.1.  Server Exports

   On a filehandle, UNIX server the
   traditional LOOKUP is preserved to map a file name to filehandle
   without establishing state on space describes all the server.  The policy of granting
   access or modifying files is managed reachable by
   pathnames under the root directory or "/".  On a Windows NT server based on
   the
   client's state.  These mechanisms can implement policy ranging from
   advisory only locking to full mandatory locking.


8.1.  Locking

   It is assumed that manipulating a lock is rare when compared to READ
   and WRITE operations.  It is also assumed that crashes and network
   partitions are relatively rare.  Therefore it is important that name space constitutes all the
   READ and WRITE operations have a lightweight mechanism to indicate if
   they possess a held lock.  A lock request contains files on disks named by mapped
   disk letters.  NFS server administrators rarely make the heavyweight
   information required entire
   server's filesystem name space available to establish a lock and uniquely define the lock
   owner.

   The following sections describe NFS clients.  More often
   portions of the transition from name space are made available via an "export"
   feature.  In previous versions of the heavy weight
   information to NFS protocol, the eventual stateid used root
   filehandle for most each export is obtained through the MOUNT protocol;
   the client sends a string that identifies the export of name space
   and the server
   locking and lease interactions.

8.1.1.  Client ID

   For each LOCK request, returns the client must identify itself to root filehandle for it.  The MOUNT
   protocol supports an EXPORTS procedure that will enumerate the server.


Expires: May 2002                                              [Page 54]

Draft Specification
   server's exports.


7.2.  Browsing Exports

   The NFS version 4 Protocol            November 2001


   This is done in such protocol provides a way as root filehandle that clients
   can use to allow obtain filehandles for correct lock
   identification and crash recovery.  Client identification is
   accomplished with two values.

   o these exports via a multi-component
   LOOKUP.  A verifier that common user experience is used to detect client reboots.

   o    A variable length opaque array to uniquely define use a client.

        For an operating system this may be graphical user
   interface (perhaps a fully qualified host
        name or IP address.  For file "Open" dialog window) to find a user level NFS client it may
        additionally contain file via
   progressive browsing through a process id or other unique sequence. directory tree.  The data structure for the Client ID would then appear as:

           struct nfs_client_id {
                   opaque verifier[4];
                   opaque id<>;
           }

   It client must be
   able to move from one export to another export via single-component,
   progressive LOOKUP operations.

   This style of browsing is possible through not well supported by the mis-configuration of a NFS version 2 and
   3 protocols.  The client or expects all LOOKUP operations to remain
   within a single server filesystem.  For example, the
   existence of device attribute
   will not change.  This prevents a rogue client from taking name space paths
   that two clients end up using the same
   nfs_client_id.  This situation is avoided by "negotiating" span exports.

   An automounter on the
   nfs_client_id between client and server with the use can obtain a snapshot of the
   SETCLIENTID and SETCLIENTID_CONFIRM operations.  The following
   describes server's
   name space using the two scenarios EXPORTS procedure of negotiation.

   1    Client has never connected to the server

        In this case MOUNT protocol.  If it
   understands the client generates server's pathname syntax, it can create an nfs_client_id and
        unless another client has the same nfs_client_id.id field, image of
   the server accepts server's name space on the request. client.  The server also records parts of the
        principal (or principal to uid mapping) from name space
   that are not exported by the credential server are filled in the RPC request with a "pseudo
   filesystem" that contains the nfs_client_id
        negotiation request (SETCLIENTID operation).

        Two clients might still use allows the same nfs_client_id.id due user to perhaps configuration error.  For example, a High
        Availability configuration where the nfs_client_id.id is
        derived browse from the ethernet controller address and both
        systems have the same address.  In this case, the result one mounted
   filesystem to another.  There is a switched union that returns, in addition drawback to
        NFS4ERR_CLID_INUSE, the network address (the rpcbind netid
        and universal address) this representation of
   the client that is using server's name space on the id.


   2    Client client: it is re-connecting to static.  If the server after
   administrator adds a client reboot

        In this case, new export the client still generates an nfs_client_id
        but the nfs_client_id.id field will be unaware of it.


7.3.  Server Pseudo Filesystem

   NFS version 4 servers avoid this name space inconsistency by
   presenting all the same as the
        nfs_client_id.id generated prior to reboot.  If exports within the framework of a single server
        finds that the principal/uid is equal
   name space.  An NFS version 4 client uses LOOKUP and READDIR
   operations to the previously
        "registered" nfs_client_id.id, then locks associated with browse seamlessly from one export to another.  Portions


Expires: May 2002 February 2003                                         [Page 55] 60]

Draft Specification      NFS version 4 Protocol            November 2001              August 2002


   of the old nfs_client_id server name space that are immediately released.  If the
        principal/uid is not equal, then this is exported are bridged via a rogue client
   "pseudo filesystem" that provides a view of exported directories
   only.  A pseudo filesystem has a unique fsid and behaves like a
   normal, read only filesystem.

   Based on the request is returned in error.  For more discussion construction of
        crash recovery semantics, see the section on "Crash
        Recovery".

        It server's name space, it is possible for a retransmission
   that multiple pseudo filesystems may exist.  For example,

   /a         pseudo filesystem
   /a/b       real filesystem
   /a/b/c     pseudo filesystem
   /a/b/c/d   real filesystem

   Each of request to be
        received by the server after the server has acted upon and
        responded to the original client request.  Therefore to
        mitigate effects of the retransmission of the SETCLIENTID
        operation, the client pseudo filesystems are considered separate entities and server use
   therefore will have a confirmation step. unique fsid.


7.4.  Multiple Roots

   The server returns DOS and Windows operating environments are sometimes described as
   having "multiple roots".  filesystems are commonly represented as
   disk letters.  MacOS represents filesystems as top level names.  NFS
   version 4 servers for these platforms can construct a confirmation verifier pseudo file
   system above these root names so that the client
        then sends to the server disk letters or volume names
   are simply directory names in the SETCLIENTID_CONFIRM
        operation.  Once the server receives pseudo root.


7.5.  Filehandle Volatility

   The nature of the confirmation server's pseudo filesystem is that it is a logical
   representation of filesystem(s) available from the client, server.
   Therefore, the locking state for pseudo filesystem is most likely constructed
   dynamically when the client server is released.

   In both cases, upon success, NFS4_OK first instantiated.  It is returned.  To help reduce expected
   that the
   amount of data transferred pseudo filesystem may not have an on OPEN and LOCK, the server will also
   return a unique 64-bit clientid value that disk counterpart from
   which persistent filehandles could be constructed.  Even though it is a shorthand reference
   to
   preferable that the nfs_client_id values presented by server provide persistent filehandles for the client.  From this point
   forward,
   pseudo filesystem, the NFS client will use the clientid to refer to itself.

   The clientid assigned should expect that pseudo file
   system filehandles are volatile.  This can be confirmed by checking
   the server should associated "fh_expire_type" attribute for those filehandles in
   question.  If the filehandles are volatile, the NFS client must be chosen so that it will
   not conflict
   prepared to recover a filehandle value (e.g. with a clientid previously assigned by multi-component
   LOOKUP) when receiving an error of NFS4ERR_FHEXPIRED.


7.6.  Exported Root

   If the server. server's root filesystem is exported, one might conclude that
   a pseudo-filesystem is not needed.  This
   applies across server restarts or reboots.  When would be wrong.  Assume the
   following filesystems on a clientid server:

           /       disk1  (exported)
           /a      disk2  (not exported)


Expires: February 2003                                         [Page 61]

Draft Specification      NFS version 4 Protocol              August 2002


           /a/b    disk3  (exported)

   Because disk2 is
   presented to not exported, disk3 cannot be reached with simple
   LOOKUPs.  The server must bridge the gap with a pseudo-filesystem.


7.7.  Mount Point Crossing

   The server and filesystem environment may be constructed in such a way
   that clientid one filesystem contains a directory which is not recognized, as would
   happen after 'covered' or
   mounted upon by a second filesystem.  For example:

           /a/b            (filesystem 1)
           /a/b/c/d        (filesystem 2)

   The pseudo filesystem for this server reboot, may be constructed to look
   like:

           /               (place holder/not exported)
           /a/b            (filesystem 1)
           /a/b/c/d        (filesystem 2)

   It is the server will reject server's responsibility to present the request with pseudo filesystem
   that is complete to the error NFS4ERR_STALE_CLIENTID.  When this happens, client.  If the client must
   obtain sends a new clientid by use lookup request
   for the path "/a/b/c/d", the server's response is the filehandle of
   the SETCLIENTID operation and then
   proceed to any other necessary recovery for filesystem "/a/b/c/d".  In previous versions of the NFS protocol,
   the server reboot case
   (See would respond with the section "Server Failure and Recovery"). filehandle of directory "/a/b/c/d"
   within the filesystem "/a/b".

   The NFS client must also employ the SETCLIENTID operation when will be able to determine if it
   receives a NFS4ERR_STALE_STATEID error using a stateid derived from
   its current clientid, since this also indicates crosses a server reboot which
   has invalidated mount
   point by a change in the existing clientid (see value of the next section
   "nfs_lockowner "fsid" attribute.


7.8.  Security Policy and stateid Definition" for details).


8.1.2.  Server Release Name Space Presentation

   The application of Clientid

   If the server determines that the client holds no associated state
   for its clientid, server's security policy needs to be carefully
   considered by the server implementor.  One may choose to release limit the clientid.  The
   server may make this choice for an inactive client so that resources
   are not consumed by those intermittently active clients.  If
   viewability of portions of the
   client contacts pseudo filesystem based on the server after this release,
   server's perception of the server must ensure client's ability to authenticate itself
   properly.  However, with the client receives support of multiple security mechanisms
   and the ability to negotiate the appropriate error so that it will use of these mechanisms,
   the
   SETCLIENTID/SETCLIENTID_CONFIRM sequence server is unable to establish properly determine if a new identity.
   It should be clear that the server must client will be very hesitant able
   to release a
   clientid since the resulting work authenticate itself.  If, based on its policies, the client server
   chooses to recover from such
   an event will be limit the same burden as if contents of the pseudo filesystem, the server had failed and
   restarted.  Typically
   may effectively hide filesystems from a client that may otherwise
   have legitimate access.

   As suggested practice, the server would not release should apply the security policy of
   a clientid unless shared resource in the server's namespace to the ancestors
   components of the namespace.  For example:

           /


Expires: May 2002 February 2003                                         [Page 56] 62]

Draft Specification      NFS version 4 Protocol            November 2001


   there had been no activity from that client for many minutes.


8.1.3.  nfs_lockowner and stateid Definition

   When requesting              August 2002


           /a/b
           /a/b/c
   The /a/b/c directory is a lock, the client must present to real filesystem and is the shared resource.
   The security policy for /a/b/c is Kerberos with integrity.  The
   server should should apply the
   clientid same security policy to /, /a, and an identifier
   /a/b.  This allows for the owner extension of the requested lock.
   These two fields are referred to as protection of the nfs_lockowner and
   server's namespace to the
   definition ancestors of those fields are:

   o    A clientid returned by the server as part real shared resource.

   For the case of the client's use of multiple, disjoint security mechanisms in
   the SETCLIENTID operation.

   o    A variable length opaque array used to uniquely define server's resources, the owner
        of security for a lock managed by particular object in the client.

        This may
   server's namespace should be a thread id, process id, or other unique value.


   When the server grants union of all security mechanisms of
   all direct descendants.










































Expires: February 2003                                         [Page 63]

Draft Specification      NFS version 4 Protocol              August 2002


8.  File Locking and Share Reservations

   Integrating locking into the lock, NFS protocol necessarily causes it responds with a unique 64-bit
   stateid.  The stateid is used as a shorthand reference to be
   stateful.  With the
   nfs_lockowner, since inclusion of share reservations the server will be maintaining protocol
   becomes substantially more dependent on state than the
   correspondence traditional
   combination of NFS and NLM [XNFS].  There are three components to
   making this state manageable:

   o    Clear division between them.

   The client and server is free

   o    Ability to form the stateid reliably detect inconsistency in any manner that it chooses
   as long as it is able to recognize invalid state between client
        and out-of-date stateids.
   This requirement includes those stateids generated by earlier
   instances of the server.  From this, server

   o    Simple and robust recovery mechanisms

   In this model, the client can be properly
   notified of a server restart.  This notification will occur when owns the state information.  The client presents a stateid
   communicates its view of this state to the server from a previous
   instantiation. as needed.  The server must be
   client is also able to distinguish detect inconsistent state before modifying a
   file.

   To support Win32 share reservations it is necessary to atomically
   OPEN or CREATE files.  Having a separate share/unshare operation
   would not allow correct implementation of the following situations and
   return Win32 OpenFile API.  In
   order to correctly implement share semantics, the error as specified:

   o    The stateid was generated by an earlier server instance (i.e.
        before previous NFS
   protocol mechanisms used when a server reboot).  The error NFS4ERR_STALE_STATEID should file is opened or created (LOOKUP,
   CREATE, ACCESS) need to be returned.

   o replaced.  The stateid was generated by the current server instance but NFS version 4 protocol has
   an OPEN operation that subsumes the
        stateid no longer designates NFS version 3 methodology of
   LOOKUP, CREATE, and ACCESS.  However, because many operations require
   a filehandle, the current locking traditional LOOKUP is preserved to map a file name
   to filehandle without establishing state for on the
        lockowner-file pair in question (i.e. one or more locking
        operations has occurred). server.  The error NFS4ERR_OLD_STATEID should
        be returned.

        This error condition will policy
   of granting access or modifying files is managed by the server based
   on the client's state.  These mechanisms can implement policy ranging
   from advisory only occur locking to full mandatory locking.


8.1.  Locking

   It is assumed that manipulating a lock is rare when compared to READ
   and WRITE operations.  It is also assumed that crashes and network
   partitions are relatively rare.  Therefore it is important that the client issues
   READ and WRITE operations have a
        locking request which changes lightweight mechanism to indicate if
   they possess a stateid while an I/O held lock.  A lock request
        that uses that stateid is outstanding.

   o contains the heavyweight
   information required to establish a lock and uniquely define the lock
   owner.

   The stateid was generated by following sections describe the current server instance but transition from the heavy weight
   information to the eventual stateid does not designate a locking state used for any active
        lockowner-file pair.  The error NFS4ERR_BAD_STATEID should be most client and server
   locking and lease interactions.

8.1.1.  Client ID

   For each LOCK request, the client must identify itself to the server.


Expires: May 2002 February 2003                                         [Page 57] 64]

Draft Specification      NFS version 4 Protocol            November 2001


        returned.              August 2002


   This error condition will occur when there has been is done in such a logic
        error on way as to allow for correct lock
   identification and crash recovery.  A sequence of a SETCLIENTID
   operation followed by a SETCLIENTID_CONFIRM operation is required to
   establish the part identification onto the server.  Establishment of
   identification by a new incarnation of the client or server.  This should not
        happen.

   One mechanism also has the effect
   of immediately breaking any leased state that may be used a previous incarnation
   of the client might have had on the server, as opposed to satisfy these requirements is forcing the
   new client incarnation to wait for the server leases to divide stateids into three fields:

   o    A expire.  Breaking
   the lease state amounts to the server verifier which uniquely designates a particular removing all lock, share
   reservation, and, where the server
        instantiation.

   o    An index into a table of locking-state structures.

   o    A sequence value which is incremented for each stateid that is not supporting the
   CLAIM_DELEGATE_PREV claim type, all delegation state associated with the
   same index into the locking-state table.


   By matching the incoming stateid and its field values client with the same identity. For discussion of delegation
   state
   held at recovery, see the server, section "Delegation Recovery".

   Client identification is encapsulated in the server following structure:

           struct nfs_client_id4 {
                   verifier4     verifier;
                   opaque        id<NFS4_OPAQUE_LIMIT>;
           };

   The first field, verifier is able to easily determine if a
   stateid client incarnation verifier that is valid for its current instantiation and state.  If
   used to detect client reboots. Only if the
   stateid verifier is not valid, different from
   that the appropriate error can be supplied to server has previously recorded the
   client.


8.1.4.  Use of client (as identified by
   the stateid

   All READ and WRITE operations contain a stateid.  If second field f the
   nfs_lockowner performs a READ or WRITE on a range of bytes within a
   locked range, structure, id) does the stateid (previously returned by server start the server) must be
   used to indicate that
   process of cancelling the appropriate lock (record or share) is held.
   If no state client's leased state.

   The second field, id is established by the client, either record lock or share
   lock, a stateid of all bits 0 is used.  If no conflicting locks variable length string that uniquely
   defines the client.

   There are
   held on several considerations for how the file, client generates the server may service id
   string:

   o    The string should be unique so that multiple clients do not
        present the READ or WRITE operation.
   If a conflict with an explicit lock occurs, same string. The consequences of two clients
        presenting the same string range from one client getting an
        error is returned for
   the operation (NFS4ERR_LOCKED). This allows "mandatory locking" to one client having its leased state abruptly and
        unexpectedly cancelled.

   o    The string should be
   implemented.

   A stateid selected so the subsequent incarnations
        (e.g. reboots) of all bits 1 (one) allows READ operations to bypass record
   locking checks at the server.  However, WRITE operations with stateid
   with bits all 1 (one) do not bypass record locking checks.  File
   locking checks are handled by same client cause the OPEN operation (see client to present
        the section
   "OPEN/CLOSE Operations").

   An explicit lock may not same string. The implementor is cautioned from an approach
        that requires the string to be granted while recorded in a READ or WRITE operation
   with conflicting implicit locking is being performed.


8.1.5.  Sequencing local file because
        this precludes the use of Lock Requests

   Locking the implementation in an environment
        where there is no local disk and all file access is from an NFS
        version 4 server.

   o    The string should be different for each server network address
        that the client accesses, rather than most NFS operations as it requires "at-
   most-one" semantics common to all server
        network addresses. The reason is that are it may not provided by ONCRPC.  ONCRPC over a be possible for
        the client to tell if same server is listening on multiple
        network addresses. If the client issues SETCLIENTID with the


Expires: May 2002 February 2003                                         [Page 58] 65]

Draft Specification      NFS version 4 Protocol            November 2001


   reliable transport is not sufficient because a sequence              August 2002


        same id string to each network address of locking
   requests may span multiple TCP connections.  In such a server, the face of
   retransmission or reordering, lock or unlock requests must have a
   well defined
        server will think it is the same client, and consistent behavior.  To accomplish this, each lock
   request contains a sequence number that is a consecutively increasing
   integer.  Different nfs_lockowners have different sequences.  The successive
        SETCLIENTID will cause the server maintains to begin the last sequence number (L) received and process of
        removing the
   response client's previous leased state.

   o    The algorithm for generating the string should not assume that was returned.

   Note
        the client's network address won't change.  This includes
        changes between client incarnations and even changes while the
        client is stilling running in its current incarnation. This
        means that for requests if the client includes just the client's and server's
        network address in the id string, there is a real risk, after
        the client gives up the network address, that contain another client,
        using a sequence number, similar algorithm for each
   nfs_lockowner, there should be no more than one outstanding request.

   If a request with generate the id string, will
        generating a previous sequence number (r < L) is received, it
   is rejected with conflicting id string.


   Given the return above considerations, an example of error NFS4ERR_BAD_SEQID.  Given a
   properly-functioning well generated id
   string is one that includes:

   o    The server's network address.

   o    The client's network address.

   o    For a user level NFS version 4 client, the response it should contain
        additional information to (r) must have been
   received before distinguish the last request (L) was sent.  If a duplicate of
   last request (r == L) is received, client from other user
        level clients running on the stored response is returned.
   If same host, such as a request beyond the next sequence (r == L + 2) is received, process id or
        other unique sequence.

   o    Additional information that tends to be unique, such as one or
        more of:

        - The client machines serial number (for privacy reasons, it is
   rejected with
          best to perform some one way function on the return serial number).

        - A MAC address.

        - The timestamp of error NFS4ERR_BAD_SEQID.  Sequence
   history is reinitialized whenever when the client verifier changes.

   Since NFS version 4 software was first
          installed on the sequence number client (though this is represented with an unsigned 32-bit
   integer, the arithmetic involved with subject to the sequence number is mod
   2^32.

   It
          previously mentioned caution about using information that is critical the server maintain
          stored in a file, because the last response sent file might only be accessible
          over NFS version 4).

        - A true random number. However since this number ought to be
          the same between client to provide a more reliable cache of duplicate non-idempotent
   requests than incarnations, this shares the same
          problem as that of the traditional cache described in [Juszczak].
   The traditional duplicate request cache uses a least recently used
   algorithm for removing unneeded requests. However, using the last lock
   request and response on timestamp of the software
          installation.

   As a given nfs_lockowner must be cached as long
   as security measure, the lock server MUST NOT cancel a client's leased
   state exists on if the server.


8.1.6.  Recovery from Replayed Requests

   As described above, principal established the sequence number state for a given id string is per nfs_lockowner.  As
   long
   not the same as the server maintains principal issuing the last sequence number received SETCLIENTID.

   Note that SETCLIENTID and
   follows the methods described above, there are no risks of SETCLIENTID_CONFIRM has a
   Byzantine router re-sending old requests.  The secondary purpose


Expires: February 2003                                         [Page 66]

Draft Specification      NFS version 4 Protocol              August 2002


   of establishing the information the server need only
   maintain the nfs_lockowner, sequence number state as long as there
   are open files or closed files with locks outstanding.

   LOCK, LOCKU, OPEN, OPEN_DOWNGRADE, and CLOSE each contain a sequence
   number and therefore needs to make callbacks to
   the risk client for purpose of supporting delegations. It is permitted to
   change this information via SETCLIENTID and SETCLIENTID_CONFIRM
   within the replay same incarnation of these operations
   resulting in undesired effects is non-existent while the server
   maintains client without removing the nfs_lockowner
   client's leased state.


8.1.7.  Releasing nfs_lockowner State

   When

   Once a particular nfs_lockowner no longer holds open or file locking


Expires: May 2002                                              [Page 59]

Draft Specification      NFS version 4 Protocol            November 2001


   state at the server, the server may choose to release the SETCLIENTID and SETCLIENTID_CONFIRM sequence
   number state associated with has successfully
   completed, the nfs_lockowner.  The server may make
   this choice based on lease expiration, for client uses the reclamation short hand client identifier, of type
   clientid4, instead of server
   memory, or other implementation specific details.  In any event, the
   server is able to do this safely only when the nfs_lockowner no longer and less compact nfs_client_id4
   structure.  This short hand client identfier (a clientid) is being utilized assigned
   by the client.  The server may choose to
   hold the nfs_lockowner state in the event and should be chosen so that retransmitted requests
   are received.  However, it will not conflict with
   a clientid previously assigned by the period to hold this state server.  This applies across
   server restarts or reboots.  When a clientid is
   implementation specific.

   In the case that presented to a LOCK, LOCKU, OPEN_DOWNGRADE, or CLOSE server
   and that clientid is
   retransmitted not recognized, as would happen after the a server has previously released the
   nfs_lockowner state,
   reboot, the server will find that the nfs_lockowner has
   no files open and an error will be returned to the client.  If reject the
   nfs_lockowner does have a file open, request with the stateid will not match and
   again an error is returned to the client.

   In the case that an OPEN is retransmitted and the nfs_lockowner is
   being used for the first time or
   NFS4ERR_STALE_CLIENTID.  When this happens, the nfs_lockowner state has been
   previously released client must obtain a
   new clientid by the server, the use of the OPEN_CONFIRM SETCLIENTID operation will prevent incorrect behavior.  When and then proceed to
   any other necessary recovery for the server observes
   the use of reboot case (See the nfs_lockowner for
   section "Server Failure and Recovery").

   The client must also employ the first time, SETCLIENTID operation when it will direct
   receives a NFS4ERR_STALE_STATEID error using a stateid derived from
   its current clientid, since this also indicates a server reboot which
   has invalidated the
   client to perform existing clientid (see the OPEN_CONFIRM next section
   "lock_owner and stateid Definition" for details).

   See the corresponding OPEN.  This
   sequence establishes the use detailed descriptions of an nfs_lockowner SETCLIENTID and associated
   sequence number.  See the section "OPEN_CONFIRM - Confirm Open" SETCLIENTID_CONFIRM
   for
   further details.


8.2.  Lock Ranges

   The protocol allows a lock owner to request a lock with one byte
   range and then either upgrade or unlock a sub-range complete specification of the initial
   lock.  It is expected that this will be an uncommon type operations.


8.1.2.  Server Release of request.
   In any case, servers or server file systems may not be able to
   support sub-range lock semantics.  In Clientid

   If the event that a server
   receives a locking request determines that represents a sub-range of current
   locking the client holds no associated state
   for the lock owner, its clientid, the server is allowed may choose to return release the
   error NFS4ERR_LOCK_RANGE to signify clientid.  The
   server may make this choice for an inactive client so that it does resources
   are not support sub-
   range lock operations.  Therefore, consumed by those intermittently active clients.  If the
   client should be prepared to
   receive contacts the server after this error and, if appropriate, report release, the error to server must ensure
   the
   requesting application.

   The client is discouraged from combining multiple independent locking
   ranges receives the appropriate error so that happen it will use the
   SETCLIENTID/SETCLIENTID_CONFIRM sequence to be adjacent into establish a single request since new identity.
   It should be clear that the server may not support sub-range requests and for reasons related must be very hesitant to release a
   clientid since the recovery of file locking state in resulting work on the client to recover from such
   an event of server failure.
   As discussed in will be the section "Server Failure and Recovery" below, same burden as if the server may employ certain optimizations during recovery had failed and
   restarted.  Typically a server would not release a clientid unless
   there had been no activity from that work
   effectively only when client for many minutes.

   Note that if the client's behavior during lock recovery id string in a SETCLIENTID request is
   similar to properly
   constructed, and if the client's locking behavior prior client takes care to use the same principal
   for each successive use of SETCLIENTID, then, barring an active
   denial of service attack, NFS4ERR_CLID_INUSE should never be
   returned.

   However, client bugs, server failure. bugs, or perhaps a deliberate change of


Expires: May 2002 February 2003                                         [Page 60] 67]

Draft Specification      NFS version 4 Protocol            November 2001


8.3.  Blocking Locks

   Some clients require              August 2002


   the support principal owner of the id string (such as the case of blocking locks.  The NFS version
   4 protocol must not rely on a callback mechanism client
   that changes security flavors, and therefore under the new flavor, there is
   unable no
   mapping to notify a client the previous owner) will in rare cases result in
   NFS4ERR_CLID_INUSE.

   In that event, when the server gets a previously denied lock SETCLIENTID for a client id
   that currently has been
   granted.  Clients have no choice state, or it has state, but to continually poll for the
   lock.  This presents a fairness problem.  Two new lock types are
   added, READW and WRITEW, and are used to indicate to the server that lease has
   expired, rather than returning NFS4ERR_CLID_INUSE, the client is requesting a blocking lock.  The server should maintain
   an ordered list of pending blocking locks.  When MUST
   allow the conflicting lock
   is released, SETCLIENTID, and confirm the server may wait new clientid if followed by
   the lease period for appropriate SETCLIENTID_CONFIRM.


8.1.3.  lock_owner and stateid Definition

   When requesting a lock, the first
   waiting client must present to re-request the lock.  After server the lease period
   expires
   clientid and an identifier for the next waiting client request is allowed owner of the requested lock.  Clients
   These two fields are required to poll at an interval sufficiently small that it is
   likely referred to acquire as the lock in a timely manner.  The server is not
   required to maintain a list lock_owner and the definition
   of pending blocked locks those fields are:

   o    A clientid returned by the server as it is used to
   increase fairness and not correct operation.  Because part of the
   unordered nature client's use of crash recovery, storing
        the SETCLIENTID operation.

   o    A variable length opaque array used to uniquely define the owner
        of a lock state to stable
   storage would be required to guarantee ordered granting of blocking
   locks.

   Servers may also note the lock types and delay returning denial of managed by the request to allow extra time for a conflicting lock to client.

        This may be
   released, allowing a successful return.  In this way, clients can
   avoid thread id, process id, or other unique value.


   When the burden of needlessly frequent polling for blocking locks.
   The server should take care in grants the length of delay in lock, it responds with a unique stateid.
   The stateid is used as a shorthand reference to the event lock_owner, since
   the
   client retransmits server will be maintaining the request.


8.4.  Lease Renewal correspondence between them.

   The purpose of a lease is to allow a server is free to remove stale locks
   that are held by a client form the stateid in any manner that has crashed or is otherwise
   unreachable.  It it chooses
   as long as it is not a mechanism for cache consistency able to recognize invalid and lease
   renewals may not be denied if the lease interval has not expired.

   The following events cause implicit renewal of all out-of-date stateids.
   This requirement includes those stateids generated by earlier
   instances of the leases for
   a given server.  From this, the client (i.e. all those sharing a given clientid).  Each can be properly
   notified of
   these is a positive indication that server restart.  This notification will occur when the
   client is still active and
   that presents a stateid to the associated state held at server from a previous
   instantiation.

   The server must be able to distinguish the server, for following situations and
   return the client, is
   still valid. error as specified:

   o    An OPEN with    The stateid was generated by an earlier server instance (i.e.
        before a valid clientid. server reboot).  The error NFS4ERR_STALE_STATEID should
        be returned.

   o    Any operation made with a valid    The stateid (CLOSE, DELEGRETURN,
        LOCK, LOCKU, OPEN, OPEN_CONFIRM, READ, RENEW, SETATTR, WRITE).
        This does not include was generated by the special stateids of all bits 0 or all
        bits 1.

        Note that if current server instance but the client had restarted or rebooted,
        stateid no longer designates the
        client would not be making these requests without issuing current locking state for the SETCLIENTID operation.
        lockowner-file pair in question (i.e. one or more locking
        operations has occurred).  The use of the SETCLIENTID error NFS4ERR_OLD_STATEID should
        be returned.


Expires: May 2002 February 2003                                         [Page 61] 68]

Draft Specification      NFS version 4 Protocol            November 2001


        operation (possibly with the addition of              August 2002


        This error condition will only occur when the optional
        SETCLIENTID_CONFIRM operation) notifies client issues a
        locking request which changes a stateid while an I/O request
        that uses that stateid is outstanding.

   o    The stateid was generated by the current server to drop instance but the
        stateid does not designate a locking state associated with the client.

        If the server for any active
        lockowner-file pair.  The error NFS4ERR_BAD_STATEID should be
        returned.

        This error condition will occur when there has rebooted, been a logic
        error on the stateids
        (NFS4ERR_STALE_STATEID error) or part of the clientid
        (NFS4ERR_STALE_CLIENTID error) will client or server.  This should not
        happen.

   One mechanism that may be valid hence
        preventing spurious renewals.

   This approach allows used to satisfy these requirements is for low overhead lease renewal which scales
   well.  In
   the typical case no extra RPC calls are required for lease
   renewal and in server to,

   o    divide the worst case one RPC is required every lease period
   (i.e. "other" field of each stateid into two fields:

        - A server verifier which uniquely designates a RENEW operation).  The number particular
        server
          instantiation.

        - An index into a table of locks held by locking-state structures.

   o    utilize the client "seqid" field of each stateid, such that seqid is
   not a factor since all state
        monotonically incremented for the client each stateid that is involved associated
        with the
   lease renewal action.

   Since all operations that create a new lease also renew existing
   leases, same index into the server must maintain a common lease expiration time for
   all valid leases for a given client.  This lease time can then be
   easily updated upon implicit lease renewal actions.


8.5.  Crash Recovery

   The important requirement in crash recovery is that both locking-state table.

   By matching the client incoming stateid and its field values with the server know when state
   held at the other has failed.  Additionally, it server, the server is
   required that a client sees able to easily determine if a consistent view of data across server
   restarts or reboots.  All READ
   stateid is valid for its current instantiation and WRITE operations that may have
   been queued within state.  If the client or network buffers must wait until
   stateid is not valid, the
   client has successfully recovered appropriate error can be supplied to the locks protecting
   client.


8.1.4.  Use of the READ stateid and Locking

   All READ, WRITE operations.


8.5.1.  Client Failure and Recovery

   In the event that SETATTR operations contain a client fails, the server may recover the client's
   locks when stateid.  For the associated leases have expired.  Conflicting locks
   from another client may only be granted after
   purposes of this lease expiration.
   If section, SETATTR operations which change the client is able to restart or reinitialize within size
   attribute of a file are treated as if they are writing the lease
   period area
   between the client may be forced to wait old and new size (i.e. the remainder of range truncated or added to
   the lease
   period before obtaining new locks.

   To minimize client delay upon restart, lock requests are associated
   with an instance file by means of the client by a client supplied verifier.  This
   verifier SETATTR), even where SETATTR is part of not
   explicitly mentioned in the initial SETCLIENTID call made by text.

   If the client.
   The server returns lock_owner performs a clientid as READ or WRITE in a result of situation in which it
   has established a lock or share reservation on the SETCLIENTID
   operation.  The client then confirms server (any OPEN
   constitutes a share reservation) the use of stateid (previously returned by
   the verifier with
   SETCLIENTID_CONFIRM.  The clientid in combination with an opaque
   owner field is then server) must be used to indicate what locks, including both
   record locks and share reservations, are held by the client to identify lockowner.  If
   no state is established by the client, either record lock owner for
   OPEN.  This chain or share
   reservation, a stateid of associations all bits 0 is then used to identify used.  Regardless whether a
   stateid of all locks
   for bits 0, or a particular client. stateid returned by the server is used,


Expires: May 2002 February 2003                                         [Page 62] 69]

Draft Specification      NFS version 4 Protocol            November 2001


   Since the verifier will be changed by              August 2002


   if there is a conflicting share reservation or mandatory record lock
   held on the client upon each
   initialization, file, the server can compare a new verifier MUST refuse to service the verifier
   associated with currently held locks READ or WRITE
   operation.

   Share reservations are established by OPEN operations and determine by their
   nature are mandatory in that they do not
   match.  This signifies when the client's new instantiation and subsequent
   loss OPEN denies READ or WRITE
   operations, that denial results in such operations being rejected
   with error NFS4ERR_LOCKED.  Record locks may be implemented by the
   server as either mandatory or advisory, or the choice of locking state.  As a result, mandatory or
   advisory behavior may be determined by the server is free to release
   all locks held which are associated with on the old clientid which was
   derived from basis of the old verifier.

   For secure environments,
   file being accessed (for example, some UNIX-based servers support a change in
   "mandatory lock bit" on the verifier must mode attribute such that if set, record
   locks are required on the file before I/O is possible).  When record
   locks are advisory, they only cause prevent the
   release granting of locks associated conflicting
   lock requests and have no effect on READ's or WRITE's.  Mandatory
   record locks, however, prevent conflicting I/O operations.  When they
   are attempted, they are rejected with NFS4ERR_LOCKED. Assuming an
   operating environment like UNIX that requires it, when the authenticated requester.  This
   is required to prevent client
   gets NFS4ERR_LOCKED on a rogue entity from freeing otherwise valid
   locks.

   Note that file it knows it has the verifier must have proper share
   reservation for, it will need to issue a LOCK request on the same uniqueness properties region
   of the verifier for file that includes the COMMIT operation.


8.5.2.  Server Failure and Recovery

   If region the server loses locking state (usually as I/O was to be performed on,
   with an appropriate locktype (i.e. READ*_LT for a result READ operation,
   WRITE*_LT for a WRITE operation).

   With NFS version 3, there was no notion of a restart
   or reboot), it must allow clients time stateid so there was no
   way to discover this fact and re-
   establish tell if the application process of the lost locking state.  The client must be able to re-
   establish sending the locking state without having READ
   or WRITE operation had also acquired the server deny valid
   requests because appropriate record lock on
   the server has granted conflicting access to another
   client.  Likewise, if file. Thus there is was no way to implement mandatory locking. With
   the possibility stateid construct, this barrier has been removed.

   Note that clients have not
   yet re-established their locking state for a file, UNIX environments that support mandatory file locking,
   the server must
   disallow READ distinction between advisory and WRITE operations for that file.  The duration of
   this recovery period mandatory locking is equal to subtle.  In
   fact, advisory and mandatory record locks are exactly the duration of same in so
   far as the APIs and requirements on implementation. If the mandatory
   lock attribute is set on the file, the lease period.

   A client can determine that server failure (and thus loss of locking
   state) checks to see if the
   lockowner has occurred, when an appropriate shared (read) or exclusive (write)
   record lock on the region it receives one of two errors.  The
   NFS4ERR_STALE_STATEID error indicates a stateid invalidated by a
   reboot wishes to read or restart.  The NFS4ERR_STALE_CLIENTID error indicates write to. If there is
   no appropriate lock, the server checks if there is a
   clientid invalidated conflicting lock
   (which can be done by reboot or restart.  When either attempting to acquire the conflicting lock on
   the behalf of these are
   received, the client must establish a new clientid (See the section
   "Client ID") lockowner, and re-establish if successful, release the locking state as discussed below.

   The period of special handling of locking and READs and WRITEs, equal
   in duration to lock
   after the lease period, READ or WRITE is referred to as the "grace
   period".  During the grace period, clients recover locks and the
   associated state by reclaim-type locking requests (i.e. LOCK requests
   with reclaim set to true done), and OPEN operations with a claim type of
   CLAIM_PREVIOUS).  During the grace period, if there is, the server must reject
   READ and WRITE operations and non-reclaim locking requests (i.e.
   other LOCK and OPEN operations) with an error of NFS4ERR_GRACE.

   If returns
   NFS4ERR_LOCKED.

   For Windows environments, there are no advisory record locks, so the
   server can reliably determine that granting a non-reclaim
   request will not conflict with reclamation of always checks for record locks by other clients, during I/O requests.

   Thus, the NFS4ERR_GRACE error NFS version 4 LOCK operation does not have need to be returned distinguish
   between advisory and mandatory record locks. It is the non-
   reclaim client request can be serviced.  For NFS version 4
   server's processing of the server to be able to
   service READ and WRITE operations during the grace period, it must
   again be able to guarantee that no possible conflict could arise introduces
   the distinction.

   Every stateid other than the special stateid values noted in this


Expires: May 2002 February 2003                                         [Page 63] 70]

Draft Specification      NFS version 4 Protocol            November 2001


   between              August 2002


   section, whether returned by an impending reclaim locking request and OPEN-type operation (i.e. OPEN,
   OPEN_DOWNGRADE), or by a LOCK-type operation (i.e. LOCK or LOCKU),
   defines an access mode for the READ file (i.e. READ, WRITE, or WRITE
   operation.  If READ-WRITE)
   as established by the server is unable to offer original OPEN which began the stateid sequence,
   and as modified by subsequent OPEN's and OPEN_DOWNGRADE's within that guarantee,
   stateid sequence.  When a READ, WRITE, or SETATTR which specifies the
   NFS4ERR_GRACE error must be returned
   size attribute, is done, the operation is subject to checking against
   the client.

   For a server access mode to provide simple, valid handling during verify that the grace
   period, operation is appropriate given the easiest method
   OPEN with which the operation is to simply reject all non-reclaim
   locking requests associated.

   In the case of WRITE-type operations (i.e. WRITE's and READ SETATTR's
   which set size), the server must verify that the access mode allows
   writing and WRITE operations by returning return an NFS4ERR_OPENMODE error if it does not.  In the
   case, of READ, the
   NFS4ERR_GRACE error.  However, a server may keep information about
   granted locks in stable storage.  With this information, perform the server
   could determine if a regular lock corresponding check on the
   access mode, or it may choose to allow READ or on opens for WRITE operation can be
   safely processed.

   For example, only,
   to accommodate clients whose write implementation may unavoidably do
   reads (e.g. due to buffer cache constraints).  However, even if a count of locks on a given file is available
   READ's are allowed in
   stable storage, these circumstances, the server can track reclaimed locks MUST still
   check for the file and
   when all reclaims have been processed, non-reclaim locking requests
   may be processed.  This way the server can ensure locks that non-reclaim
   locking requests will not conflict with potential reclaim requests.
   With respect to I/O requests, if the server is able to determine READ (e.g. another open
   specify denial of READ's).  Note that
   there are no outstanding reclaim requests for a file by information
   from stable storage or another similar mechanism, server which does enforce the processing of
   I/O requests could proceed normally
   access mode check on READ's need not explicitly check for conflicting
   share reservations since the file.

   To reiterate, existence of OPEN for a server read access
   guarantees that allows non-reclaim lock and I/O
   requests no conflicting share reservation can exist.

   A stateid of all bits 1 (one) MAY allow READ operations to be processed during bypass
   locking checks at the grace period, it server.  However, WRITE operations with a
   stateid with bits all 1 (one) MUST determine
   that no lock subsequently reclaimed will be rejected NOT bypass locking checks and that no lock
   subsequently reclaimed would have prevented any I/O operation
   processed during the grace period.

   Clients should be prepared for are
   treated exactly the return same as if a stateid of NFS4ERR_GRACE errors for
   non-reclaim all bits 0 were used.

   A lock and I/O requests.  In this case the client should
   employ may not be granted while a retry mechanism for READ or WRITE operation using one
   of the request.  A delay (on special stateids is being performed and the order range of
   several seconds) between retries should be used to avoid overwhelming the server.  Further discussion lock
   request conflicts with the range of the general is included in
   [Floyd].  The client must account for READ or WRITE operation.  For
   the server purposes of this paragraph, a conflict occurs when a shared lock
   is requested and a WRITE operation is being performed, or an
   exclusive lock is requested and either a READ or a WRITE operation is
   being performed. A SETATTR that sets size is able treated similarly to
   perform I/O and non-reclaim locking requests within the grace period a
   WRITE as well discussed above.


8.1.5.  Sequencing of Lock Requests

   Locking is different than most NFS operations as those it requires "at-
   most-one" semantics that can are not do so.

   A reclaim-type provided by ONCRPC.  ONCRPC over a
   reliable transport is not sufficient because a sequence of locking request outside the server's grace period can
   only succeed if
   requests may span multiple TCP connections.  In the server can guarantee that no conflicting lock face of
   retransmission or
   I/O request has been granted since reboot reordering, lock or restart.


8.5.3.  Network Partitions unlock requests must have a
   well defined and Recovery

   If the duration of consistent behavior.  To accomplish this, each lock
   request contains a network partition sequence number that is greater than the lease
   period provided by the server, the server will have not received a
   lease renewal from the client.  If this occurs, the consecutively increasing
   integer.  Different lock_owners have different sequences.  The server may free
   all locks held for the client.  As a result, all stateids held by
   maintains the
   client will become invalid or stale.  Once last sequence number (L) received and the client response that
   was returned.  The first request issued for any given lock_owner is able to
   reach the server after such a network partition, all I/O submitted by
   the client with the now invalid stateids will fail
   issued with the server
   returning the error NFS4ERR_EXPIRED.  Once this error is received, a sequence number of zero.


Expires: May 2002 February 2003                                         [Page 64] 71]

Draft Specification      NFS version 4 Protocol            November 2001


   the client will suitably notify the application              August 2002


   Note that held the lock.

   As for requests that contain a courtesy to the client or as an optimization, the server may
   continue to hold locks on behalf of a client sequence number, for which recent
   communication has extended beyond the lease period. each
   lock_owner, there should be no more than one outstanding request.

   If the server
   receives a lock or I/O request that conflicts (r) with one a previous sequence number (r < L) is received,
   it is rejected with the return of these
   courtesy locks, error NFS4ERR_BAD_SEQID.  Given a
   properly-functioning client, the server response to (r) must free the courtesy lock and grant have been
   received before the
   new request. last request (L) was sent.  If a duplicate of
   last request (r == L) is received, the server continues to hold locks stored response is returned.
   If a request beyond the expiration of a
   client's lease, next sequence (r == L + 2) is received, it is
   rejected with the server MUST employ a method return of recording this
   fact in its stable storage.  Conflicting locks requests from another error NFS4ERR_BAD_SEQID.  Sequence
   history is reinitialized whenever the SETCLIENTID/SETCLIENTID_CONFIRM
   sequence changes the client may be serviced after verifier.

   Since the lease expiration.  There are various
   scenarios involving server failure after such sequence number is represented with an event that require unsigned 32-bit
   integer, the storage of these lease expirations or network partitions.  One
   scenario arithmetic involved with the sequence number is as follows:

        A client holds a lock at mod
   2^32.

   It is critical the server and encounters a
        network partition and is unable maintain the last response sent to renew the associated
        lease.  A second
   client obtains to provide a conflicting lock and then
        frees more reliable cache of duplicate non-idempotent
   requests than that of the lock.  After traditional cache described in [Juszczak].
   The traditional duplicate request cache uses a least recently used
   algorithm for removing unneeded requests. However, the unlock last lock
   request by and response on a given lock_owner must be cached as long as
   the second
        client, lock state exists on the server reboots or reinitializes.  Once server.

   The client MUST monotonically increment the
        server recovers, sequence number for the network partition heals
   CLOSE, LOCK, LOCKU, OPEN, OPEN_CONFIRM, and OPEN_DOWNGRADE
   operations.  This is true even in the
        original client attempts to reclaim event that the original lock.

   In previous
   operation that used the sequence number received an error.  The only
   exception to this scenario and without any state information, rule is if the server will
   allow previous operation received one of
   the reclaim and following errors: NFS4ERR_STALE_CLIENTID, NFS4ERR_STALE_STATEID,
   NFS4ERR_BAD_STATEID, NFS4ERR_BAD_SEQID.


8.1.6.  Recovery from Replayed Requests

   As described above, the client will be in an inconsistent state
   because sequence number is per lock_owner.  As long
   as the server or maintains the client has last sequence number received and follows
   the methods described above, there are no knowledge risks of the conflicting
   lock. a Byzantine router
   re-sending old requests.  The server may choose to store this lease expiration or network
   partitioning state in a way that will need only identify maintain the client
   (lock_owner, sequence number) state as a
   whole.  Note that this may potentially lead to lock reclaims being
   denied unnecessarily because of a mix of conflicting long as there are open files
   or closed files with locks outstanding.

   LOCK, LOCKU, OPEN, OPEN_DOWNGRADE, and non-
   conflicting locks.  The server may also choose to store information
   about CLOSE each lock that has an expired lease with an associated
   conflicting lock.  The choice contain a sequence
   number and therefore the risk of the amount and type replay of state
   information that is stored these operations
   resulting in undesired effects is left to the implementor.  In any case, non-existent while the server must have enough state information to enable correct
   recovery from multiple partitions and multiple server failures.



8.6.  Recovery from
   maintains the lock_owner state.


8.1.7.  Releasing lock_owner State

   When a Lock Request Timeout particular lock_owner no longer holds open or Abort

   In file locking


Expires: February 2003                                         [Page 72]

Draft Specification      NFS version 4 Protocol              August 2002


   state at the event a lock request times out, a client server, the server may decide choose to not
   retry release the request. sequence
   number state associated with the lock_owner.  The client server may also abort make
   this choice based on lease expiration, for the request when reclamation of server
   memory, or other implementation specific details.  In any event, the
   process for which it was issued
   server is terminated (e.g. in UNIX due able to a
   signal.  It do this safely only when the lock_owner no longer
   is possible though that being utilized by the client.  The server received the request
   and acted upon it.  This would change may choose to hold the
   lock_owner state on the server without
   the client being aware of in the change.  It is paramount event that retransmitted requests are
   received.  However, the
   client re-synchronize period to hold this state with server before it attempts any other


Expires: May 2002                                              [Page 65]

Draft Specification      NFS version 4 Protocol            November 2001


   operation is implementation
   specific.

   In the case that takes a seqid and/or a stateid with the same
   nfs_lockowner. This LOCK, LOCKU, OPEN_DOWNGRADE, or CLOSE is straightforward to do without a special re-
   synchronize operation.

   Since
   retransmitted after the server maintains the last lock request and response
   received on the nfs_lockowner, for each nfs_lockowner, has previously released the client
   should cache lock_owner
   state, the last lock request it sent such server will find that the lock request
   did not receive a response.  From this, lock_owner has no files open and
   an error will be returned to the next time client.  If the client lock_owner does have
   a lock operation for the nfs_lockowner, it can send file open, the cached
   request, if there is one, stateid will not match and if again an error is
   returned to the request was one client.


8.1.8.  Use of Open Confirmation

   In the case that established
   state (e.g. a LOCK or an OPEN operation) is retransmitted and the client can follow up with a
   request to remove lock_owner is being
   used for the state (e.g. a LOCKU first time or CLOSE operation).  With
   this approach, the sequencing and stateid information on lock_owner state has been previously
   released by the client
   and server for server, the given nfs_lockowner will re-synchronize and in
   turn use of the lock state OPEN_CONFIRM operation will re-synchronize.


8.7.  Server Revocation of Locks

   At any point,
   prevent incorrect behavior.  When the server can revoke locks held by a client and observes the
   client must be prepared use of the
   lock_owner for this event.  When the client detects that
   its locks have been or may have been revoked, first time, it will direct the client is
   responsible to perform
   the OPEN_CONFIRM for validating the state information between itself corresponding OPEN.  This sequence
   establishes the use of an lock_owner and associated sequence number.
   Since the server.  Validating locking state for OPEN_CONFIRM sequence connects a new open_owner on the client means that it
   must verify or reclaim state for each lock currently held.

   The first instance of lock revocation is upon
   server reboot or re-
   initialization.  In this instance the client will receive an error
   (NFS4ERR_STALE_STATEID or NFS4ERR_STALE_CLIENTID) and the client will
   proceed with normal crash recovery as described in an existing open_owner on a client, the previous
   section. sequence number
   may have any value.  The second lock revocation event is OPEN_CONFIRM step assures the inability to renew server that
   the lease
   period.  While this value received is considered a rare or unusual event, the client
   must be prepared to recover.  Both the server and client will be able
   to detect the failure to renew correct one.  See the lease and section "OPEN_CONFIRM
   - Confirm Open" for further details.

   There are capable a number of
   recovering without data corruption.  For the server, it tracks situations in which the
   last renewal event serviced requirement to confirm
   an OPEN would pose difficulties for the client and knows when the lease
   will expire.  Similarly, the client must track operations which will
   renew the lease period.  Using the time that each such request was
   sent and the time server, in that the corresponding reply was
   they would be prevented from acting in a timely fashion on
   information received, the
   client should bound the time because that information would be provisional,
   subject to deletion upon non-confirmation.  Fortunately, these are
   situations in which the corresponding renewal could
   have occurred on server can avoid the need for confirmation
   when responding to open requests.  The two constraints are:

   o    The server and thus determine if it is possible that must not bestow a lease period expiration could have occurred. delegation for any open which would
        require confirmation.

   o    The third lock revocation event can occur as a result of
   administrative intervention within the lease period.  While this is
   considered server MUST NOT require confirmation on a rare event, it is possible reclaim-type open
        (i.e. one specifying claim type CLAIM_PREVIOUS or
        CLAIM_DELEGATE_PREV).

        These constraints are related in that reclaim-type opens are the server's
   administrator has decided to release or revoke a particular lock held
   by
        only ones in which the client.  As server may be required to send a result of revocation, the client will receive an
   error of NFS4ERR_EXPIRED and
        delegation.  For CLAIM_NULL, sending the error delegation is received within the lease
   period optional
        while for the lock.  In this instance the client may assume that CLAIM_DELEGATE_CUR, no delegation is sent.


Expires: May 2002 February 2003                                         [Page 66] 73]

Draft Specification      NFS version 4 Protocol            November 2001


   only              August 2002


        Delegations being sent with an open requiring confirmation are
        troublesome because recovering from non-confirmation adds undue
        complexity to the nfs_lockowner's locks have been lost.  The client notifies protocol while requiring confirmation on
        reclaim-type opens poses difficulties in that the lock holder appropriately.  The client may not assume inability to
        resolve the lease
   period has been renewed as a result status of failed operation.

   When the client determines the reclaim until lease period expiration may
        make it difficult to have expired, timely determination of the
   client must mark all set of
        locks held for the associated lease as
   "unvalidated".  This means the client has been unable to re-establish
   or confirm being reclaimed (since the appropriate lock state with grace period may expire).

        Requiring open confirmation on reclaim-type opens is avoidable
        because of the server.  As described
   in nature of the previous section on crash recovery, there are scenarios environments in which the server may grant conflicting locks after the lease period
   has expired for a client.  When it such opens
        are done.  For CLAIM_PREVIOUS opens, this is possible immediately after
        server reboot, so there should be no time for lockowners to be
        created, found to be unused, and recycled.  For
        CLAIM_DELEGATE_PREV opens, we are dealing with a client reboot
        situation.  A server which supports delegation can be sure that
        no lockowners for that the lease period
   has expired, the client must validate each lock currently held to have been recycled since client
        initialization and thus can ensure that a conflicting lock has confirmation will not been granted. be
        required.


8.2.  Lock Ranges

   The client may
   accomplish this task by issuing an I/O request, either protocol allows a pending I/O lock owner to request a lock with a byte range
   and then either upgrade or unlock a zero-length read, specifying sub-range of the stateid associated with initial lock.
   It is expected that this will be an uncommon type of request.  In any
   case, servers or server filesystems may not be able to support sub-
   range lock semantics.  In the event that a server receives a locking
   request that represents a sub-range of current locking state for the
   lock in question. If owner, the response server is allowed to return the request is success, error
   NFS4ERR_LOCK_RANGE to signify that it does not support sub-range lock
   operations.  Therefore, the client has validated all of should be prepared to receive this
   error and, if appropriate, report the locks governed by error to the requesting
   application.

   The client is discouraged from combining multiple independent locking
   ranges that stateid and
   re-established happen to be adjacent into a single request since the appropriate state between itself
   server may not support sub-range requests and for reasons related to
   the server.
   If the I/O request is not successful, then one or more recovery of file locking state in the locks
   associated with the stateid was revoked by the event of server failure.
   As discussed in the section "Server Failure and Recovery" below, the client
   must notify
   server may employ certain optimizations during recovery that work
   effectively only when the owner.


8.8.  Share Reservations

   A share reservation client's behavior during lock recovery is a mechanism
   similar to control access the client's locking behavior prior to a file.  It
   is a separate server failure.


8.3.  Upgrading and independent mechanism from record locking.  When Downgrading Locks

   If a client opens has a file, write lock on a record, it issues can request an OPEN operation to atomic
   downgrade of the server
   specifying lock to a read lock via the type of access required (READ, WRITE, or BOTH) and LOCK request, by setting
   the type of access to deny others (deny NONE, READ, WRITE, or BOTH). READ_LT. If the OPEN fails server supports atomic downgrade, the client
   request will succeed. If not, it will fail the application's open request.

   Pseudo-code definition of the semantics:


                if ((request.access & file_state.deny)) ||
                      (request.deny & file_state.access)) return (NFS4ERR_DENIED) NFS4ERR_LOCK_NOTSUPP.
   The constants used for the OPEN client should be prepared to receive this error, and OPEN_DOWNGRADE operations for if
   appropriate, report the
   access and deny fields are as follows:

   const OPEN4_SHARE_ACCESS_READ   = 0x00000001;
   const OPEN4_SHARE_ACCESS_WRITE  = 0x00000002;
   const OPEN4_SHARE_ACCESS_BOTH   = 0x00000003;

   const OPEN4_SHARE_DENY_NONE     = 0x00000000;
   const OPEN4_SHARE_DENY_READ     = 0x00000001;
   const OPEN4_SHARE_DENY_WRITE    = 0x00000002;
   const OPEN4_SHARE_DENY_BOTH     = 0x00000003; error to the requesting application.


Expires: May 2002 February 2003                                         [Page 67] 74]

Draft Specification      NFS version 4 Protocol            November 2001


8.9.  OPEN/CLOSE Operations

   To provide correct share semantics,              August 2002


   If a client MUST use has a read lock on a record, it can request an atomic
   upgrade of the OPEN
   operation lock to obtain a write lock via the initial filehandle and indicate the desired
   access and what if any access to deny.  Even if LOCK request by setting
   the client intends type to
   use a stateid of all 0's WRITE_LT or all 1's, WRITEW_LT.  If the server does not support
   atomic upgrade, it must still obtain will return NFS4ERR_LOCK_NOTSUPP.  If the
   filehandle for upgrade
   can be achieved without an existing conflict, the regular file request will
   succeed.  Otherwise, the server will return either NFS4ERR_DENIED or
   NFS4ERR_DEADLOCK.  The error NFS4ERR_DEADLOCK is returned if the
   client issued the LOCK request with the OPEN operation so type set to WRITEW_LT and the
   appropriate share semantics can be applied.  For clients that do not
   have
   server has detected a deny mode built into their open programming interfaces, deny
   equal to NONE deadlock. The client should be used.

   The OPEN operation with prepared to
   receive such errors and if appropriate, report the CREATE flag, also subsumes error to the CREATE
   operation for regular files as used in previous versions of
   requesting application.


8.4.  Blocking Locks

   Some clients require the support of blocking locks.  The NFS
   protocol.  This allows a create with version
   4 protocol must not rely on a share callback mechanism and therefore is
   unable to be done atomically.

   The CLOSE operation removes all share locks held by the nfs_lockowner
   on that file.  If record locks are held, the client SHOULD release
   all locks before issuing notify a CLOSE.  The server MAY free all
   outstanding locks on CLOSE but some servers may not support the CLOSE
   of client when a file that still previously denied lock has record locks held.  The server MUST return
   failure if any locks would exist after been
   granted.  Clients have no choice but to continually poll for the CLOSE.

   The LOOKUP operation will return
   lock.  This presents a filehandle without establishing
   any fairness problem.  Two new lock state on the server.  Without a valid stateid, types are
   added, READW and WRITEW, and are used to indicate to the server
   will assume that
   the client has the least access.  For example, a file
   opened with deny READ/WRITE cannot be accessed using a filehandle
   obtained through LOOKUP because it would not have a valid stateid
   (i.e. using is requesting a stateid blocking lock.  The server should maintain
   an ordered list of all bits 0 or all bits 1).


8.10.  Open Upgrade and Downgrade pending blocking locks.  When an OPEN is done for a file and the lockowner for which the open conflicting lock
   is being done already has the file open, released, the result is to upgrade server may wait the
   open file status maintained on lease period for the server first
   waiting client to include re-request the access and
   deny bits specified by lock.  After the new OPEN as well as those for lease period
   expires the existing
   OPEN.  The result next waiting client request is allowed the lock.  Clients
   are required to poll at an interval sufficiently small that there it is one open file, as far as
   likely to acquire the
   protocol lock in a timely manner.  The server is concerned, and it includes the union not
   required to maintain a list of the access pending blocked locks as it is used to
   increase fairness and
   deny bits for all not correct operation.  Because of the OPEN requests completed.  Only a single
   CLOSE will
   unordered nature of crash recovery, storing of lock state to stable
   storage would be done required to reset the effects guarantee ordered granting of both OPEN's.  Note that
   the client, when issuing the OPEN, blocking
   locks.

   Servers may not know that the same file is
   in fact being opened.  The above only applies if both OPEN's result
   in the OPEN'ed object being designated by also note the same filehandle.

   When lock types and delay returning denial of
   the server chooses request to export multiple filehandles corresponding allow extra time for a conflicting lock to be
   released, allowing a successful return.  In this way, clients can
   avoid the same file object and returns different filehandles on two
   different OPEN's burden of the same file object, the needlessly frequent polling for blocking locks.
   The server MUST NOT "OR"
   together should take care in the access and deny bits and coalesce length of delay in the two open files.
   Instead event the
   client retransmits the request.


8.5.  Lease Renewal

   The purpose of a lease is to allow a server must maintain separate OPEN's with separate
   stateid's and will require separate CLOSE's to free them.

   When multiple open files on remove stale locks
   that are held by a client that has crashed or is otherwise
   unreachable.  It is not a mechanism for cache consistency and lease
   renewals may not be denied if the lease interval has not expired.

   The following events cause implicit renewal of all of the leases for
   a given client are merged into (i.e. all those sharing a single open given clientid).  Each of
   these is a positive indication that the client is still active and


Expires: May 2002 February 2003                                         [Page 68] 75]

Draft Specification      NFS version 4 Protocol            November 2001


   file object on the server, the close of one of the open files (on the
   client) may necessitate change of              August 2002


   that the access and deny status of associated state held at the
   open file on server, for the server.  This client, is because
   still valid.

   o    An OPEN with a valid clientid.

   o    Any operation made with a valid stateid (CLOSE, DELEGPURGE,
        DELEGRETURN, LOCK, LOCKU, OPEN, OPEN_CONFIRM, OPEN_DOWNGRADE,
        READ, RENEW, SETATTR, WRITE).  This does not include the union special
        stateids of the access and
   deny all bits for 0 or all bits 1.

        Note that if the remaining open's may client had restarted or rebooted, the
        client would not be smaller (i.e. a proper
   subset) than previously. making these requests without issuing
        the SETCLIENTID/SETCLIENTID_CONFIRM sequence.  The OPEN_DOWNGRADE operation is used to
   make use of
        the necessary change and SETCLIENTID/SETCLIENTID_CONFIRM sequence (one that
        changes the client should use it to update verifier) notifies the server so that share reservation requests by other clients are
   handled properly.


8.11.  Short and Long Leases

   When determining to drop
        the time period for locking state associated with the client.
        SETCLIENTID/SETCLIENTID_CONFIRM never renews a lease.

        If the server lease, has rebooted, the usual stateids
        (NFS4ERR_STALE_STATEID error) or the clientid
        (NFS4ERR_STALE_CLIENTID error) will not be valid hence
        preventing spurious renewals.

   This approach allows for low overhead lease tradeoffs apply.  Short leases renewal which scales
   well.  In the typical case no extra RPC calls are good required for fast server
   recovery at lease
   renewal and in the worst case one RPC is required every lease period
   (i.e. a cost of increased RENEW or READ (with zero length)
   requests.  Longer leases are certainly kinder and gentler to large
   internet servers trying to handle very large numbers of clients. operation).  The number of RENEW requests drop in proportion to locks held by the lease time.  The
   disadvantages of long leases are slower recovery after server failure
   (server must wait for leases to expire and grace period before
   granting new lock requests) and increased file contention (if client
   fails to transmit an unlock request then server must wait for lease
   expiration before granting new locks).

   Long leases are usable if the server is able to store lease
   not a factor since all state in
   non-volatile memory.  Upon recovery, the server can reconstruct for the
   lease state from its non-volatile memory and continue operation client is involved with
   its clients and therefore long leases are not an issue.


8.12.  Clocks and Calculating Lease Expiration

   To avoid the need for synchronized clocks,
   lease times are granted by renewal action.

   Since all operations that create a new lease also renew existing
   leases, the server as must maintain a common lease expiration time delta.  However, there is for
   all valid leases for a given client.  This lease time can then be
   easily updated upon implicit lease renewal actions.


8.6.  Crash Recovery

   The important requirement in crash recovery is that both the client
   and server clocks do not drift excessively over the duration
   of server know when the lock.  There other has failed.  Additionally, it is also the issue
   required that a client sees a consistent view of propagation delay data across the
   network which could easily be several hundred milliseconds as well as
   the possibility that requests will be lost server
   restarts or reboots.  All READ and need to be
   retransmitted.

   To take propagation delay into account, WRITE operations that may have
   been queued within the client should subtract it
   from lease times (e.g. if or network buffers must wait until the
   client estimates has successfully recovered the one-way
   propagation delay as 200 msec, then it can assume that locks protecting the lease is
   already 200 msec old when it gets it). READ and
   WRITE operations.


8.6.1.  Client Failure and Recovery

   In addition, it will take
   another 200 msec to get a response back to the server.  So the client
   must send event that a lock renewal or write data back to client fails, the server 400 msec
   before may recover the client's
   locks when the associated leases have expired.  Conflicting locks
   from another client may only be granted after this lease would expire. expiration.


Expires: May 2002 February 2003                                         [Page 69] 76]

Draft Specification      NFS version 4 Protocol            November 2001


8.13.  Migration, Replication and State

   When responsibility for handling a given file system              August 2002


   If the client is transferred able to a new server (migration) restart or reinitialize within the lease
   period the client chooses to use an alternate
   server (e.g. in response may be forced to server unresponsiveness) in wait the context remainder of file system replication, the appropriate handling lease
   period before obtaining new locks.

   To minimize client delay upon restart, lock requests are associated
   with an instance of state shared
   between the client and server (i.e. locks, leases, stateid's, and
   clientid's) by a client supplied verifier.  This
   verifier is as described below.  The handling differs between
   migration and replication.  For related discussion of file server
   state and recover part of such see the sections under "File Locking and
   Share Reservations"


8.13.1.  Migration and State

   In initial SETCLIENTID call made by the case client.
   The server returns a clientid as a result of migration, the servers involved in SETCLIENTID
   operation.  The client then confirms the migration use of a
   file system SHOULD transfer all server state from the original to the
   new server.  This must be done clientid with
   SETCLIENTID_CONFIRM.  The clientid in a way that combination with an opaque
   owner field is transparent then used by the client to identify the
   client. lock owner for
   OPEN.  This state transfer will ease the client's transition when a
   file system migration occurs.  If the servers are successful in
   transferring chain of associations is then used to identify all state, locks
   for a particular client.

   Since the client verifier will continue to use stateid's
   assigned be changed by the original server.  Therefore client upon each
   initialization, the new server must
   recognize these stateid's as valid.  This holds true for can compare a new verifier to the clientid
   as well.  Since responsibility for an entire file system is
   transferred verifier
   associated with a migration event, there is no possibility currently held locks and determine that
   conflicts will arise on they do not
   match.  This signifies the client's new server as a result of the transfer instantiation and subsequent
   loss of
   locks. locking state.  As part of a result, the transfer of information between servers, leases would
   be transferred as well.  The leases being transferred server is free to release
   all locks held which are associated with the new
   server will typically have a different expiration time old clientid which was
   derived from those for the same client, previously on the new server.  To maintain the
   property old verifier.

   Note that all leases on a given server for a given client expire
   at the same time, the server should advance the expiration time to verifier must have the later same uniqueness properties of
   the leases being transferred or verifier for the leases already
   present.  This allows COMMIT operation.


8.6.2.  Server Failure and Recovery

   If the client to maintain lease renewal server loses locking state (usually as a result of both
   classes without special effort.

   The servers may choose not a restart
   or reboot), it must allow clients time to transfer the state information upon
   migration.  However, this choice is discouraged.  In discover this case, when
   the client presents state information from the original server, fact and re-
   establish the lost locking state.  The client must be prepared able to receive either NFS4ERR_STALE_CLIENTID or
   NFS4ERR_STALE_STATEID from re-
   establish the new server.  The client should then
   recover its locking state information as it normally would in response to a without having the server failure.  The new deny valid
   requests because the server must take care has granted conflicting access to allow for another
   client.  Likewise, if there is the
   recovery of possibility that clients have not
   yet re-established their locking state information as it would in for a file, the event of server
   restart.


8.13.2.  Replication must
   disallow READ and State

   Since client switch-over in the case WRITE operations for that file.  The duration of replication
   this recovery period is not under


Expires: May 2002                                              [Page 70]

Draft Specification      NFS version 4 Protocol            November 2001


   server control, equal to the handling duration of state is different.  In this case,
   leases, stateid's and clientid's do not have validity across a
   transition from one server to another.  The client must re-establish
   its locks on the new server.  This lease period.

   A client can be compared to the re-
   establishment of locks by means of reclaim-type requests after a
   server reboot.  The difference is determine that the server has no provision to
   distinguish requests reclaiming locks from those obtaining new locks
   or to defer the latter.  Thus, a client re-establishing a lock on the
   new server (by means failure (and thus loss of locking
   state) has occurred, when it receives one of two errors.  The
   NFS4ERR_STALE_STATEID error indicates a LOCK stateid invalidated by a
   reboot or OPEN request), may have the
   requests denied due to restart.  The NFS4ERR_STALE_CLIENTID error indicates a conflicting lock.  Since replication is
   intended for read-only use of filesystems, such denial of locks
   should not pose large difficulties in practice.
   clientid invalidated by reboot or restart.  When an attempt to
   re-establish a lock on either of these are
   received, the client must establish a new server is denied, clientid (See the client should
   treat section
   "Client ID") and re-establish the situation locking state as if his original lock had been revoked.


8.13.3.  Notification discussed below.

   The period of Migrated Lease

   In the case special handling of lease renewal, the client may not be submitting
   requests for a file system that has been migrated locking and READs and WRITEs, equal
   in duration to another server.
   This can occur because of the implicit lease renewal mechanism.  The
   client renews leases for all file systems when submitting a request period, is referred to any one file system at as the server.

   In order for "grace
   period".  During the client grace period, clients recover locks and the
   associated state by reclaim-type locking requests (i.e. LOCK requests
   with reclaim set to schedule renewal true and OPEN operations with a claim type of leases that may have
   been relocated to
   CLAIM_PREVIOUS).  During the new server, grace period, the client server must find out about
   lease relocation before those leases expire.  To accomplish this, all reject


Expires: February 2003                                         [Page 77]

Draft Specification      NFS version 4 Protocol              August 2002


   READ and WRITE operations which implicitly renew leases for a client and non-reclaim locking requests (i.e. OPEN,
   CLOSE, READ, WRITE, RENEW, LOCK, LOCKT, LOCKU), will return the
   other LOCK and OPEN operations) with an error
   NFS4ERR_LEASE_MOVED if responsibility for any of NFS4ERR_GRACE.

   If the leases to be
   renewed has been transferred to server can reliably determine that granting a new server.  This condition non-reclaim
   request will
   continue until not conflict with reclamation of locks by other clients,
   the client receives an NFS4ERR_MOVED NFS4ERR_GRACE error does not have to be returned and the
   server receives the subsequent GETATTR(fs_locations) for an access to
   each file system for which a lease has been moved to a new server.

   When a non-
   reclaim client receives an NFS4ERR_LEASE_MOVED error, it should
   perform some operation, such as a RENEW, on each file system
   associated with request can be serviced.  For the server in question.  When to be able to
   service READ and WRITE operations during the client receives grace period, it must
   again be able to guarantee that no possible conflict could arise
   between an
   NFS4ERR_MOVED error, the client can follow impending reclaim locking request and the normal process to
   obtain READ or WRITE
   operation.  If the new server information (through the fs_locations
   attribute) and perform renewal of those leases on is unable to offer that guarantee, the new server.  If
   NFS4ERR_GRACE error must be returned to the client.

   For a server has not had state transferred to it transparently, it will
   receive either NFS4ERR_STALE_CLIENTID or NFS4ERR_STALE_STATEID from provide simple, valid handling during the new server, as described above, and can then recover state
   information as it does in grace
   period, the event of server failure.









Expires: May 2002                                              [Page 71]

Draft Specification      NFS version 4 Protocol            November 2001


9.  Client-Side Caching

   Client-side caching of data, of file attributes, and of file names easiest method is
   essential to providing good performance with the NFS protocol.
   Providing distributed cache coherence is a difficult problem simply reject all non-reclaim
   locking requests and
   previous versions of the NFS protocol have not attempted it.
   Instead, several NFS client implementation techniques have been used
   to reduce the problems that a lack of coherence poses for users.
   These techniques have not been clearly defined by earlier protocol
   specifications READ and it is often unclear what is valid or invalid
   client behavior.

   The NFS version 4 protocol uses many techniques similar to those that
   have been used in previous protocol versions.  The NFS version 4
   protocol does not provide distributed cache coherence. WRITE operations by returning the
   NFS4ERR_GRACE error.  However, it
   defines a more limited set of caching guarantees to allow server may keep information about
   granted locks and
   share reservations to be used without destructive interference from
   client side caching.

   In addition, the NFS version 4 protocol introduces a delegation
   mechanism which allows many decisions normally made by in stable storage.  With this information, the server to
   could determine if a regular lock or READ or WRITE operation can be made locally by clients.  This mechanism provides efficient
   support
   safely processed.

   For example, if a count of the common cases where sharing is infrequent or where
   sharing locks on a given file is read-only.


9.1.  Performance Challenges for Client-Side Caching

   Caching techniques used available in previous versions of
   stable storage, the NFS protocol have
   been successful in providing good performance.  However, several
   scalability challenges server can arise when those techniques are used with
   very large numbers of clients.  This is particularly true when
   clients are geographically distributed which classically increases
   the latency track reclaimed locks for cache revalidation requests.

   The previous versions of the NFS protocol repeat their file data
   cache validation and
   when all reclaims have been processed, non-reclaim locking requests at the time the file is opened.
   may be processed.  This
   behavior can have serious performance drawbacks.  A common case is
   one in which a file is only accessed by a single client.  Therefore,
   sharing is infrequent.

   In this case, repeated reference to way the server to find can ensure that no
   conflicts exist is expensive.  A better option non-reclaim
   locking requests will not conflict with regards potential reclaim requests.
   With respect to
   performance I/O requests, if the server is able to allow a client determine that repeatedly opens
   there are no outstanding reclaim requests for a file to do
   so without reference to the server.  This is done until potentially
   conflicting operations by information
   from stable storage or another client actually occur.

   A similar situation arises in connection with file locking.  Sending
   file lock and unlock mechanism, the processing of
   I/O requests to could proceed normally for the file.

   To reiterate, for a server as well as the read that allows non-reclaim lock and
   write I/O
   requests necessary to make data caching consistent with the
   locking semantics (see be processed during the section "Data Caching and File Locking")
   can severely limit performance.  When locking is used to provide


Expires: May 2002                                              [Page 72]

Draft Specification      NFS version 4 Protocol            November 2001


   protection against infrequent conflicts, a large penalty is incurred.
   This penalty may discourage grace period, it MUST determine
   that no lock subsequently reclaimed will be rejected and that no lock
   subsequently reclaimed would have prevented any I/O operation
   processed during the use grace period.

   Clients should be prepared for the return of file locking by applications.

   The NFS version 4 protocol provides more aggressive caching
   strategies with NFS4ERR_GRACE errors for
   non-reclaim lock and I/O requests.  In this case the following design goals:


   o    Compatibility with client should
   employ a large range of server semantics.

   o    Provide retry mechanism for the same caching benefits as previous versions of request.  A delay (on the
        NFS protocol when unable order of
   several seconds) between retries should be used to provide avoid overwhelming
   the more aggressive model.

   o    Requirements server.  Further discussion of the general issue is included in
   [Floyd].  The client must account for aggressive caching are organized so the server that a
        large portion of is able to
   perform I/O and non-reclaim locking requests within the benefit grace period
   as well as those that can be obtained even when not all
        of do so.

   A reclaim-type locking request outside the requirements server's grace period can be met.

   The appropriate requirements for
   only succeed if the server are discussed in later
   sections in which specific forms of caching are covered. (see the
   section "Open Delegation").


9.2.  Delegation and Callbacks

   Recallable delegation of can guarantee that no conflicting lock or
   I/O request has been granted since reboot or restart.

   A server responsibilities for may, upon restart, establish a file to new value for the lease
   period.  Therefore, clients should, once a
   client improves performance by avoiding repeated requests to new clientid is


Expires: February 2003                                         [Page 78]

Draft Specification      NFS version 4 Protocol              August 2002


   established, refetch the
   server in lease_time attribute and use it as the absence of inter-client conflict.  With basis
   for lease renewal for the lease associated with that server. However,
   the use of a
   "callback" RPC from server to client, must establish, for this restart event, a grace period at
   least as long as the lease period for the previous server recalls delegated
   responsibilities when another
   instantiation. This allows the client engages in sharing of a
   delegated file.

   A delegation is passed from state obtained during the
   previous server instance to the client, specifying the
   object of the delegation be reliably re-established.



8.6.3.  Network Partitions and Recovery

   If the type of delegation.  There are
   different types duration of delegations but each type contains a stateid to be
   used to represent network partition is greater than the delegation when performing operations that
   depend on lease
   period provided by the delegation.  This stateid is similar to those
   associated with locks and share reservations but differs in that server, the
   stateid for a delegation is associated with server will have not received a clientid and
   lease renewal from the client.  If this occurs, the server may be
   used on behalf of free
   all the nfs_lockowners locks held for the given client.  A
   delegation  As a result, all stateids held by the
   client will become invalid or stale.  Once the client is made able to
   reach the client as server after such a whole and not to any specific
   process or thread of control within it.

   Because callback RPCs may not work in network partition, all environments (due to
   firewalls, for example), correct protocol operation does not depend
   on them.  Preliminary testing of callback functionality I/O submitted by means of a
   CB_NULL procedure determines whether callbacks can be supported.  The
   CB_NULL procedure checks
   the continuity of client with the now invalid stateids will fail with the callback path.  A server makes a preliminary assessment of callback availability to a
   given
   returning the error NFS4ERR_EXPIRED.  Once this error is received,
   the client and avoids delegating responsibilities until it has
   determined will suitably notify the application that callbacks are supported.  Because held the granting of lock.

   As a
   delegation is always conditional upon courtesy to the absence client or as an optimization, the server may
   continue to hold locks on behalf of conflicting
   access, clients must not assume that a delegation will be granted and
   they must always be prepared client for OPENs to be processed without any


Expires: May 2002                                              [Page 73]

Draft Specification      NFS version 4 Protocol            November 2001


   delegations being granted.

   Once granted, a delegation behaves in most ways like a lock.  There
   is an associated which recent
   communication has extended beyond the lease period.  If the server
   receives a lock or I/O request that is subject to renewal together conflicts with all one of the other leases held by that client.

   Unlike these
   courtesy locks, an operation by a second client to a delegated file
   will cause the server to recall a delegation through a callback.

   On recall, must free the client holding courtesy lock and grant the delegation must flush modified
   state (such as modified data) to
   new request.

   If the server and return continues to hold locks beyond the
   delegation.  The conflicting request will not receive expiration of a response
   until the recall is complete.  The recall is considered complete when
   client's lease, the server MUST employ a method of recording this
   fact in its stable storage.  Conflicting lock requests from another
   client returns may be serviced after the delegation lease expiration.  There are various
   scenarios involving server failure after such an event that require
   the storage of these lease expirations or network partitions.  One
   scenario is as follows:

        A client holds a lock at the server times out on the
   recall and revokes encounters a
        network partition and is unable to renew the delegation as associated
        lease.  A second client obtains a result of conflicting lock and then
        frees the timeout.
   Following lock.  After the resolution of unlock request by the recall, second
        client, the server has the
   information necessary to grant reboots or deny reinitializes.  Once the second client's request.

   At
        server recovers, the time network partition heals and the
        original client receives a delegation recall, it may have
   substantial state that needs to be flushed attempts to reclaim the server.  Therefore, original lock.

   In this scenario and without any state information, the server should will
   allow sufficient time for the delegation to be
   returned since it may involve numerous RPCs to the server.  If the
   server is able to determine that reclaim and the client is diligently flushing will be in an inconsistent state to
   because the server as a result of or the recall, client has no knowledge of the conflicting
   lock.

   The server may extend
   the usual time allowed for choose to store this lease expiration or network
   partitioning state in a recall.  However, way that will only identify the time allowed for
   recall completion should not be unbounded.

   An example of this is when responsibility to mediate opens on client as a given
   file is delegated
   whole.  Note that this may potentially lead to lock reclaims being


Expires: February 2003                                         [Page 79]

Draft Specification      NFS version 4 Protocol              August 2002


   denied unnecessarily because of a client (see the section "Open Delegation"). mix of conflicting and non-
   conflicting locks.  The server will not know what opens are in effect on the client.
   Without this knowledge the server will be unable may also choose to determine if store information
   about each lock that has an expired lease with an associated
   conflicting lock.  The choice of the
   access amount and deny type of state for the file allows any particular open until
   the delegation for the file has been returned.

   A client failure or a network partition can result in failure to
   respond
   information that is stored is left to a recall callback. the implementor.  In this any case,
   the server will revoke
   the delegation which in turn will render useless any modified must have enough state
   still on information to enable correct
   recovery from multiple partitions and multiple server failures.

   For further discussion of revocation of locks see the client.


9.2.1.  Delegation section "Server
   Revocation of Locks".


8.7.  Recovery

   There are three situations that delegation recovery must deal with:

   o    Client reboot or restart

   o    Server reboot or restart

   o    Network partition (full from a Lock Request Timeout or callback-only) Abort

   In the event the a lock request times out, a client reboots or restarts, the failure may decide to renew


Expires: May 2002                                              [Page 74]

Draft Specification      NFS version 4 Protocol            November 2001


   leases will result in not
   retry the revocation of record locks and share
   reservations.  Delegations, however, request.  The client may be treated a bit
   differently.

   There will be situations in also abort the request when the
   process for which delegations will need it was issued is terminated (e.g. in UNIX due to be
   reestablished after a client reboots or restarts.  The reason for
   this
   signal).  It is possible though that the client may have file data stored locally and this data
   was associated with server received the previously held delegations.  The client will
   need to reestablish request
   and acted upon it.  This would change the appropriate file state on the server.

   To allow for this type of client recovery, the server may extend without
   the
   period for delegation recovery beyond client being aware of the typical lease expiration
   period.  This implies change.  It is paramount that requests from the
   client re-synchronize state with server before it attempts any other clients
   operation that conflict takes a seqid and/or a stateid with these delegations will need the same
   lock_owner. This is straightforward to wait.  Because do without a special re-
   synchronize operation.

   Since the normal recall
   process may require significant time server maintains the last lock request and response
   received on the lock_owner, for each lock_owner, the client to flush changed
   state to should
   cache the server, other clients need be prepared for delays last lock request it sent such that
   occur because of the lock request did
   not receive a conflicting delegation.  This longer interval
   would increase response.  From this, the window next time the client does a
   lock operation for clients to reboot and consult stable
   storage so that the delegations lock_owner, it can be reclaimed.  For open
   delegations, such delegations are reclaimed using OPEN with a claim
   type of CLAIM_DELEGATE_PREV.  (See send the sections on "Data Caching and
   Revocation" and "Operation 18: OPEN" for discussion of open
   delegation cached request, if
   there is one, and if the details of request was one that established state (e.g.
   a LOCK or OPEN respectively).

   When operation), the server reboots will return the cached result
   or restarts, delegations are reclaimed (using if never saw the OPEN operation request, perform it.  The client can follow up
   with CLAIM_DELEGATE_PREV) in a similar fashion request to
   record locks and share reservations.  However, there is remove the state (e.g. a slight
   semantic difference.  In LOCKU or CLOSE operation).
   With this approach, the normal case if sequencing and stateid information on the
   client and server decides that a
   delegation should not be granted, it performs for the requested action
   (e.g. OPEN) without granting given lock_owner will re-synchronize and in
   turn the lock state will re-synchronize.


8.8.  Server Revocation of Locks

   At any delegation.  For reclaim, point, the server
   grants the delegation but can revoke locks held by a special designation is applied so that client and the
   client treats must be prepared for this event.  When the delegation as having client detects that
   its locks have been granted but recalled
   by the server.  Because of this, or may have been revoked, the client has is
   responsible for validating the duty to write all
   modified state to the server information between itself and then return
   the delegation.  This
   process of handling delegation reclaim reconciles three principles of server.  Validating locking state for the NFS Version 4 protocol:


   o    Upon reclaim, a client reporting resources assigned to means that it by an
        earlier server instance
   must be granted those resources.

   o    The server has unquestionable authority to determine whether
        delegations are to be granted and, once granted, whether they
        are to be continued.

   o verify or reclaim state for each lock currently held.

   The use first instance of callbacks lock revocation is not to be depended upon until server reboot or re-
   initialization.  In this instance the client
        has proven its ability to will receive them.

   When a network partition occurs, delegations are subject to freeing
   by the server when the lease renewal period expires.  This is similar
   to the behavior for locks an error
   (NFS4ERR_STALE_STATEID or NFS4ERR_STALE_CLIENTID) and share reservations.  For delegations,
   however, the server may extend the period client will
   proceed with normal crash recovery as described in which conflicting the previous


Expires: May 2002 February 2003                                         [Page 75] 80]

Draft Specification      NFS version 4 Protocol            November 2001


   requests are held off.  Eventually              August 2002


   section.

   The second lock revocation event is the occurrence of inability to renew the lease
   before expiration.  While this is considered a conflicting
   request from another rare or unusual event,
   the client must be prepared to recover.  Both the server and client
   will cause revocation of be able to detect the delegation.
   A loss failure to renew the lease and are capable
   of recovering without data corruption.  For the callback path (e.g. by later network configuration
   change) will have server, it tracks the same effect.  A recall request will fail
   last renewal event serviced for the client and
   revocation of knows when the delegation lease
   will result.

   A expire.  Similarly, the client normally finds out about revocation of a delegation when it
   uses a stateid associated with a delegation must track operations which will
   renew the lease period.  Using the time that each such request was
   sent and receives the error
   NFS4ERR_EXPIRED.  It also may find out about delegation time that the corresponding reply was received, the
   client should bound the time that the corresponding renewal could
   have occurred on the server and thus determine if it is possible that
   a lease period expiration could have occurred.

   The third lock revocation
   after event can occur as a client reboot when result of
   administrative intervention within the lease period.  While this is
   considered a rare event, it attempts is possible that the server's
   administrator has decided to reclaim release or revoke a delegation and
   receives that same error.  Note that in particular lock held
   by the case of client.  As a revoked write
   open delegation, there are issues because data result of revocation, the client will receive an
   error of NFS4ERR_EXPIRED and the error is received within the lease
   period for the lock.  In this instance the client may assume that
   only the lock_owner's locks have been modified
   by lost.  The client notifies the
   lock holder appropriately.  The client whose delegation is revoked and separately by other
   clients.  See may not assume the section "Revocation Recovery for Write Open
   Delegation" for lease
   period has been renewed as a discussion result of such issues.  Note also that when
   delegations are revoked, information about failed operation.

   When the revoked delegation
   will be written by client determines the server to stable storage (as described in lease period may have expired, the
   section "Crash Recovery").
   client must mark all locks held for the associated lease as
   "unvalidated".  This is done means the client has been unable to deal re-establish
   or confirm the appropriate lock state with the case server.  As described
   in the previous section on crash recovery, there are scenarios in
   which a the server reboots may grant conflicting locks after revoking a delegation but before the
   client holding the revoked delegation lease period
   has expired for a client.  When it is notified about possible that the
   revocation.


9.3.  Data Caching

   When applications share access lease period
   has expired, the client must validate each lock currently held to
   ensure that a set of files, they need to be
   implemented so as to take account of the possibility of conflicting
   access lock has not been granted. The client may
   accomplish this task by another application.  This is true whether the applications
   in question execute on different clients issuing an I/O request, either a pending I/O
   or reside on a zero-length read, specifying the same
   client.

   Share reservations and record locks are stateid associated with the facilities
   lock in question. If the NFS
   version 4 protocol provides to allow applications response to coordinate
   access the request is success, the
   client has validated all of the locks governed by providing mutual exclusion facilities.  The NFS version 4
   protocol's data caching must be implemented such that it does not
   invalidate stateid and
   re-established the assumptions that those using these facilities depend
   upon.


9.3.1.  Data Caching appropriate state between itself and OPENs

   In order to avoid invalidating the sharing assumptions that
   applications rely on, NFS version 4 clients should server.
   If the I/O request is not provide cached
   data to applications successful, then one or modify it on behalf more of an application when it
   would not be valid to obtain or modify that same data via a READ or
   WRITE operation.

   Furthermore, in the absence of open delegation (see locks
   associated with the section "Open
   Delegation") two additional rules apply.  Note that these rules are
   obeyed in practice stateid was revoked by many NFS version 2 the server and version 3 clients.

   o    First, cached data present on a the client
   must be revalidated after notify the owner.


8.9.  Share Reservations

   A share reservation is a mechanism to control access to a file.  It
   is a separate and independent mechanism from record locking.  When a
   client opens a file, it issues an OPEN operation to the server
   specifying the type of access required (READ, WRITE, or BOTH) and the
   type of access to deny others (deny NONE, READ, WRITE, or BOTH).  If


Expires: May 2002 February 2003                                         [Page 76] 81]

Draft Specification      NFS version 4 Protocol            November 2001


        doing an OPEN.  This is to ensure that              August 2002


   the data for OPEN fails the OPENed
        file is still correctly reflected in client will fail the client's cache. application's open request.

   Pseudo-code definition of the semantics:


                if ((request.access & file_state.deny)) ||
                      (request.deny & file_state.access))
                              return (NFS4ERR_DENIED)

   This
        validation must be checking of share reservations on OPEN is done at least when with no exception
   for an existing OPEN for the same open_owner.

   The constants used for the client's OPEN
        operation includes DENY=WRITE or BOTH thus terminating and OPEN_DOWNGRADE operations for the
   access and deny fields are as follows:

   const OPEN4_SHARE_ACCESS_READ   = 0x00000001;
   const OPEN4_SHARE_ACCESS_WRITE  = 0x00000002;
   const OPEN4_SHARE_ACCESS_BOTH   = 0x00000003;

   const OPEN4_SHARE_DENY_NONE     = 0x00000000;
   const OPEN4_SHARE_DENY_READ     = 0x00000001;
   const OPEN4_SHARE_DENY_WRITE    = 0x00000002;
   const OPEN4_SHARE_DENY_BOTH     = 0x00000003;


8.10.  OPEN/CLOSE Operations

   To provide correct share semantics, a period
        in which other clients may have had client MUST use the opportunity OPEN
   operation to open obtain the
        file with WRITE access.  Clients may choose to do initial filehandle and indicate the
        revalidation more often (i.e. at OPENs specifying DENY=NONE) desired
   access and what if any access to
        parallel the NFS version 3 protocol's practice for deny.  Even if the benefit
        of users assuming this degree client intends to
   use a stateid of cache revalidation.

   o    Second, modified data all 0's or all 1's, it must be flushed to still obtain the server before
        closing a file OPENed
   filehandle for write.  This is complementary to the
        first rule.  If the data is not flushed at CLOSE, the
        revalidation done after client OPENs as regular file is unable to
        achieve its purpose.  The other aspect to flushing with the data
        before close is that OPEN operation so the data must
   appropriate share semantics can be committed applied.  For clients that do not
   have a deny mode built into their open programming interfaces, deny
   equal to stable
        storage, at NONE should be used.

   The OPEN operation with the server, before CREATE flag, also subsumes the CREATE
   operation for regular files as used in previous versions of the NFS
   protocol.  This allows a create with a share to be done atomically.

   The CLOSE operation is requested removes all share reservations held by the client.  In
   lock_owner on that file.  If record locks are held, the case of client SHOULD
   release all locks before issuing a CLOSE.  The server reboot or restart and a
        CLOSEd file, it MAY free all
   outstanding locks on CLOSE but some servers may not be possible to retransmit the data to be
        written to support the file.  Hence, this requirement.


9.3.2.  Data Caching and File Locking

   For those applications that choose to use file locking instead of
   share reservations to exclude inconsistent file access, there is an
   analogous set CLOSE
   of constraints that apply to client side data caching.
   These rules are effective only if the file locking is used in a way
   that matches in an equivalent way the actual READ and WRITE
   operations executed.  This is as opposed to file locking that is
   based on pure convention.  For example, it is possible to manipulate
   a two-megabyte file by dividing the file into two one-megabyte
   regions and protecting access to the two regions by file still has record locks held.  The server MUST return
   failure, NFS4ERR_LOCKS_HELD, if any locks on
   bytes zero and one.  A lock for write on byte zero of the file would
   represent the right to do READ and WRITE operations on exist after the first
   region.  A
   CLOSE.

   The LOOKUP operation will return a filehandle without establishing
   any lock for write state on byte one of the file would represent server.  Without a valid stateid, the
   right to do READ and WRITE operations on server
   will assume the second region.  As long
   as all applications manipulating client has the file obey this convention, they
   will work on least access.  For example, a local file system.  However, they may not work
   opened with
   the deny READ/WRITE cannot be accessed using a filehandle


Expires: February 2003                                         [Page 82]

Draft Specification      NFS version 4 protocol unless clients refrain from data caching.

   The rules for data caching in the file locking environment are:

   o    First, when Protocol              August 2002


   obtained through LOOKUP because it would not have a client obtains valid stateid
   (i.e. using a file lock for stateid of all bits 0 or all bits 1).


8.10.1.  Close and Retention of State Information

   Since a particular
        region, CLOSE operation requests deallocation of a stateid, dealing
   with retransmission of the data cache corresponding to that region (if any
        cache data exists) must CLOSE, may pose special difficulties,
   since the state information, which normally would be revalidated.  If used to
   determine the change attribute
        indicates that state of the open file being designated, might be
   deallocated, resulting in an NFS4ERR_BAD_STATEID error.

   Servers may have been updated since deal with this problem in a number of ways.  To provide
   the cached
        data was obtained, greatest degree assurance that the client must flush or invalidate protocol is being used
   properly, a server should, rather than deallocate the
        cached data for stateid, mark
   it as close-pending, and retain the newly locked region.  A client might choose stateid with this status, until
   later deallocation.  In this way, a retransmitted CLOSE can be
   recognized since the stateid points to invalidate all of non-modified cached data state information with this
   distinctive status, so that it has for can be handled without error.

   When adopting this strategy, a server should retain the file but state
   information until the only requirement earliest of:

   o    Another validly sequenced request for correct operation the same lockowner, that
        is not a retransmission.

   o    The time that a lockowner is freed by the server due to
        invalidate all period
        with no activity.

   o    All locks for the client are freed as a result of a SETCLIENTID.


   Servers may avoid this complexity, at the data cost of less complete
   protocol error checking, by simply responding NFS4_OK in the newly locked region.


Expires: May 2002                                              [Page 77]

Draft Specification      NFS version 4 Protocol            November 2001


   o    Second, before releasing event of
   a write lock CLOSE for a region, all modified
        data for that region must be flushed to deallocated stateid, on the server.  The
        modified data assumption that this case
   must also be written to stable storage.

   Note that flushing data caused by a retranmitted close.  When adopting this approach,
   it is desirable to at least log an error when returning a no-error
   indication in this situation.  If the server maintains a reply-cache
   mechanism, it can verify the CLOSE is indeed a retransmission and
   avoid error logging in most cases.


8.11.  Open Upgrade and Downgrade

   When an OPEN is done for a file and the invalidation of cached
   data must reflect lockowner for which the actual byte ranges locked or unlocked.
   Rounding these up or down to reflect client cache block boundaries
   will cause problems if not carefully done.  For example, writing a
   modified block when only half of that block open
   is within an area being
   unlocked may cause invalid modification done already has the file open, the result is to upgrade the region outside
   open file status maintained on the
   unlocked area.  This, in turn, may be part of a region locked by
   another client.  Clients can avoid this situation server to include the access and
   deny bits specified by synchronously
   performing portions of write operations that overlap that portion
   (initial or final) the new OPEN as well as those for the existing
   OPEN.  The result is that there is not a full block.  Similarly, invalidating
   a locked area which one open file, as far as the
   protocol is not an integral number concerned, and it includes the union of full buffer blocks
   would require the client to read one or two partial blocks from access and
   deny bits for all of the
   server if OPEN requests completed.  Only a single
   CLOSE will be done to reset the revalidation procedure shows effects of both OPEN's.  Note that


Expires: February 2003                                         [Page 83]

Draft Specification      NFS version 4 Protocol              August 2002


   the data which client, when issuing the
   client possesses OPEN, may not be valid.

   The data know that the same file is written to
   in fact being opened.  The above only applies if both OPEN's result
   in the OPEN'ed object being designated by the same filehandle.

   When the server as a pre-requisite chooses to export multiple filehandles corresponding
   to the
   unlocking same file object and returns different filehandles on two
   different OPEN's of a region must be written, at the server, 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 OPEN's with separate
   stateid's and will require separate CLOSE's to stable
   storage.  The free them.

   When multiple open files on the client may accomplish this either with synchronous
   writes or by following asynchronous writes with are merged into a COMMIT operation. single open
   file object on the server, the close of one of the open files (on the
   client) may necessitate change of the access and deny status of the
   open file on the server.  This is required because retransmission the union of the modified data after a
   server reboot might conflict with access and
   deny bits for the remaining open's may be smaller (i.e. a lock held by another client.

   A proper
   subset) than previously.  The OPEN_DOWNGRADE operation is used to
   make the necessary change and the client implementation may choose to accommodate applications which
   use record locking in non-standard ways (e.g. using a record lock as
   a global semaphore) by flushing should use it to update the
   server more data upon an LOCKU
   than is covered so that share reservation requests by the locked range.  This may include modified data
   within files other than clients are
   handled properly.


8.12.  Short and Long Leases

   When determining the one time period for which the unlocks are being done.
   In such cases, server lease, the client must not interfere with applications whose
   READs and WRITEs usual
   lease tradeoffs apply.  Short leases are being done only within the bounds of record
   locks which the application holds.  For example, an application locks good for fast server
   recovery at a single byte cost of a file increased RENEW or READ (with zero length)
   requests.  Longer leases are certainly kinder and proceeds gentler to write that single byte.  A
   client that chose servers
   trying to handle a LOCKU by flushing all modified data very large numbers of clients.  The number of RENEW
   requests drop in proportion to the lease time.  The disadvantages of
   long leases are slower recovery after server could validly write that single byte in response failure (server must
   wait for leases to expire and grace period before granting new lock
   requests) and increased file contention (if client fails to transmit
   an
   unrelated unlock.  However, it unlock request then server must wait for lease expiration before
   granting new locks).

   Long leases are usable if the server is able to store lease state in
   non-volatile memory.  Upon recovery, the server can reconstruct the
   lease state from its non-volatile memory and continue operation with
   its clients and therefore long leases would not be valid to write the entire
   block in which that single written byte was located since it includes an area that is not locked issue.


8.13.  Clocks, Propagation Delay, and might be locked by another client.
   Client implementations can Calculating Lease Expiration

   To avoid this problem by dividing files with
   modified data into those the need for which all modifications synchronized clocks, lease times are done to
   areas covered granted by an appropriate record lock and those for which
   the server as a time delta.  However, there
   are modifications not covered by is a record lock.  Any writes done for requirement that the former class of files must not include areas not locked
   client and thus server clocks do not modified on drift excessively over the client.


9.3.3.  Data Caching and Mandatory File Locking

   Client side data caching needs to respect mandatory file locking when
   it duration
   of the lock.  There is in effect.  The presence also the issue of mandatory file locking for a given propagation delay across the
   network which could easily be several hundred milliseconds as well as
   the possibility that requests will be lost and need to be
   retransmitted.



Expires: May 2002 February 2003                                         [Page 78] 84]

Draft Specification      NFS version 4 Protocol            November 2001


   file is indicated in              August 2002


   To take propagation delay into account, the result flags for an OPEN.  When mandatory
   locking client should subtract it
   from lease times (e.g. if the client estimates the one-way
   propagation delay as 200 msec, then it can assume that the lease is in effect for
   already 200 msec old when it gets it).  In addition, it will take
   another 200 msec to get a file, response back to the server.  So the client
   must check for an
   appropriate file lock for data being read or written.  If send a lock
   exists for the range being read renewal or written, the client may satisfy write data back to the request using server 400 msec
   before the client's validated cache.  If an appropriate
   file lock is not held for lease would expire.

   The server's lease period configuration should take into account the range
   network distance of the read or write, the read or
   write request must not clients that will be satisfied by accessing the client's cache and server's
   resources.  It is expected that the
   request must be sent to lease period will take into
   account the server network propogation delays and other network delay
   factors for processing.  When a read or
   write request partially overlaps a locked region, the request should
   be subdivided into multiple pieces with each region (locked or not)
   treated appropriately.


9.3.4.  Data Caching and File Identity

   When clients cache data, client population.  Since the file data needs protocol does not allow
   for an automatic method to organized according determine an appropriate lease period, the
   server's administrator may have to tune the lease period.


8.14.  Migration, Replication and State

   When responsibility for handling a given file system object is transferred
   to which the data belongs.  For NFS version
   3 clients, a new server (migration) or the typical practice has been client chooses to assume for use an alternate
   server (e.g. in response to server unresponsiveness) in the purpose context
   of
   caching that distinct filehandles represent distinct file system
   objects. replication, the appropriate handling of state shared
   between the client and server (i.e. locks, leases, stateid's, and
   clientid's) is as described below.  The handling differs between
   migration and replication.  For related discussion of file server
   state and recover of such see the sections under "File Locking and
   Share Reservations"

   If server replica or a server immigrating a filesystem agrees to, or
   is expected to, accept opaque values from the client that originated
   from another server, then has it is a wise implementation practice for
   the choice servers to organize encode the "opaque" values in network byte order. This
   way, servers acting as replicas or immigrating filesystems will be
   able to parse values like stateids, directory cookies, filehandles,
   etc. even if their native byte order is different from other servers
   cooperating in the replication and maintain migration of the
   data cache on this basis. filesystem.


8.14.1.  Migration and State

   In the NFS version 4 protocol, there is now case of migration, the possibility to have
   significant deviations from a "one filehandle per object" model
   because a filehandle may be constructed on servers involved in the basis migration of the object's
   pathname.  Therefore, clients need a reliable method to determine if
   two filehandles designate the same file system object.  If clients
   were simply to assume that
   filesystem SHOULD transfer all distinct filehandles denote distinct
   objects and proceed to do data caching on this basis, caching
   inconsistencies would arise between server state from the distinct client side objects
   which mapped original to the same server side object.

   By providing
   new server.  This must be done in a method way that is transparent to differentiate filehandles, the NFS version 4
   protocol alleviates
   client.  This state transfer will ease the client's transition when a potential functional regression in comparison
   with
   filesystem migration occurs.  If the NFS version 3 protocol.  Without this method, caching
   inconsistencies within servers are successful in
   transferring all state, the same client could occur and this has not
   been present in previous versions of the NFS protocol.  Note that it
   is possible will continue to have such inconsistencies with applications executing
   on multiple clients but that is not the issue being addressed here.

   For the purposes of data caching, use stateid's
   assigned by the following steps allow an NFS
   version 4 client to determine whether two distinct filehandles denote original server.  Therefore the same new server side object:


   o    If GETATTR directed to two filehandles have different values of
        the fsid attribute, then must
   recognize these stateid's as valid.  This holds true for the filehandles represent distinct
        objects.

   o    If GETATTR clientid
   as well.  Since responsibility for any file with an fsid entire filesystem is
   transferred with a migration event, there is no possibility that matches the fsid of
   conflicts will arise on the two filehandles in question returns a unique_handles
        attribute with new server as a value result of TRUE, then the two objects are transfer of


Expires: May 2002 February 2003                                         [Page 79] 85]

Draft Specification      NFS version 4 Protocol            November 2001


        distinct.

   o    If GETATTR directed to the two filehandles does not return the
        fileid attribute for one or both              August 2002


   locks.

   As part of the handles, then the it
        cannot be determined whether the two objects are the same.
        Therefore, operations which depend on that knowledge (e.g.
        client side data caching) cannot transfer of information between servers, leases would
   be done reliably.

   o    If GETATTR directed transferred as well.  The leases being transferred to the two filehandles returns new
   server will typically have a different
        values expiration time from those for
   the fileid attribute, then they are distinct objects.

   o    Otherwise they are the same object.


9.4.  Open Delegation

   When a file is being OPENed, the server may delegate further handling
   of opens and closes for that file to client, previously on the opening client.  Any such
   delegation is recallable, since old server.  To maintain the circumstances
   property that allowed all leases on a given server for a given client expire
   at the delegation are subject to change.  In particular, same time, the server may
   receive a conflicting OPEN from another client, should advance the server must
   recall expiration time to
   the delegation before deciding whether later of the OPEN from leases being transferred or the leases already
   present.  This allows the other client to maintain lease renewal of both
   classes without special effort.

   The servers may be granted.  Making a delegation is up choose not to transfer the server and
   clients should not assume that any particular OPEN either will or
   will not result in an open delegation.  The following state information upon
   migration.  However, this choice is a typical
   set of conditions that servers might use in deciding whether OPEN
   should be delegated:

   o    The discouraged.  In this case, when
   the client presents state information from the original server, the
   client must be able to respond prepared to receive either NFS4ERR_STALE_CLIENTID or
   NFS4ERR_STALE_STATEID from the server's callback
        requests. new server.  The server will use the CB_NULL procedure for client should then
   recover its state information as it normally would in response to a test
        of callback ability.

   o
   server failure.  The client new server must have responded properly take care to previous recalls.

   o    There must be no current open conflicting with the requested
        delegation.

   o    There should be no current delegation that conflicts with allow for the
        delegation being requested.

   o    The probability
   recovery of future conflicting open requests should be
        low based on state information as it would in the recent history event of server
   restart.


8.14.2.  Replication and State

   Since client switch-over in the file.

   o    The existence of any server-specific semantics case of OPEN/CLOSE
        that would make the required handling incompatible with replication is not under
   server control, the
        prescribed handling that the delegated client would apply (see
        below).

   There are two types of open delegations, read state is different.  In this case,
   leases, stateid's and write.  A read open
   delegation allows clientid's do not have validity across a client
   transition from one server to handle, on another.  The client must re-establish
   its own, requests locks on the new server.  This can be compared to open the re-
   establishment of locks by means of reclaim-type requests after a
   file for reading
   server reboot.  The difference is that do not deny read access to others.  Multiple
   read open delegations may be outstanding simultaneously and do not


Expires: May 2002                                              [Page 80]

Draft Specification      NFS version 4 Protocol            November 2001


   conflict.  A write open delegation allows the client server has no provision to handle, on
   its own, all opens.  Only one write open delegation may exist for a
   given file at a given time and it is inconsistent with any read open
   delegations.

   When
   distinguish requests reclaiming locks from those obtaining new locks
   or to defer the latter.  Thus, a client has re-establishing a read open delegation, it may not make any changes
   to lock on the contents or attributes
   new server (by means of a LOCK or OPEN request), may have the file but it
   requests denied due to a conflicting lock.  Since replication is assured that no
   other client may do so.
   intended for read-only use of filesystems, such denial of locks
   should not pose large difficulties in practice.  When an attempt to
   re-establish a client has lock on a write open delegation,
   it may modify new server is denied, the file data since no other client will be accessing should
   treat the file's data.  The client holding a write delegation may only
   affect file attributes which are intimately connected with situation as if his original lock had been revoked.


8.14.3.  Notification of Migrated Lease

   In the case of lease renewal, the file
   data:  object_size, time_modify, change.

   When a client has an open delegation, it does may not send OPENs or
   CLOSEs to the server but updates the appropriate status internally.
   For a read open delegation, opens that cannot be handled locally
   (opens submitting
   requests for write or a filesystem that deny read access) must be sent has been migrated to the another server.

   When an open delegation is made,
   This can occur because of the response implicit lease renewal mechanism.  The
   client renews leases for all filesystems when submitting a request to
   any one filesystem at the OPEN contains an
   open delegation structure which specifies the following:

   o server.

   In order for the type of delegation (read or write)

   o    space limitation information client to control flushing schedule renewal of data on
        close (write open delegation only, see the section "Open
        Delegation and Data Caching")

   o    an nfsace4 specifying read and write permissions

   o    a stateid leases that may have
   been relocated to represent the delegation for READ and WRITE

   The stateid is separate and distinct from the stateid for new server, the OPEN
   proper.  The standard stateid, unlike the delegation stateid, is
   associated with client must find out about


Expires: February 2003                                         [Page 86]

Draft Specification      NFS version 4 Protocol              August 2002


   lease relocation before those leases expire.  To accomplish this, all
   operations which implicitly renew leases for a particular nfs_lockowner and client (i.e. OPEN,
   CLOSE, READ, WRITE, RENEW, LOCK, LOCKT, LOCKU), will continue to be
   valid after return the delegation is recalled and error
   NFS4ERR_LEASE_MOVED if responsibility for any of the file remains open.

   When a request internal leases to the client is made be
   renewed has been transferred to open a file and open
   delegation is in effect, it new server.  This condition will be accepted or rejected solely on
   continue until the basis of client receives an NFS4ERR_MOVED error and the following conditions.  Any requirement
   server receives the subsequent GETATTR(fs_locations) for other
   checks