idnits 2.17.1 draft-ietf-nfsv4-minorversion2-27.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- -- The document has examples using IPv4 documentation addresses according to RFC6890, but does not use any IPv6 documentation addresses. Maybe there should be IPv6 examples, too? Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (September 20, 2014) is 3499 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Proposed Standard ---------------------------------------------------------------------------- (See RFCs 3967 and 4897 for information about using normative references to lower-maturity documents in RFCs) -- Looks like a reference, but probably isn't: '0' on line 3985 == Missing Reference: '32K' is mentioned on line 3985, but not defined == Unused Reference: 'RFC5664' is defined on line 4292, but no explicit reference was found in the text == Unused Reference: 'RFC4506' is defined on line 4357, but no explicit reference was found in the text -- Possible downref: Non-RFC (?) normative reference: ref. 'NFSv42xdr' ** Obsolete normative reference: RFC 5661 (Obsoleted by RFC 8881) == Outdated reference: A later version (-35) exists of draft-ietf-nfsv4-rfc3530bis-33 == Outdated reference: A later version (-06) exists of draft-ietf-nfsv4-lfs-registry-01 -- Obsolete informational reference (is this intentional?): RFC 2401 (Obsoleted by RFC 4301) -- Obsolete informational reference (is this intentional?): RFC 2616 (Obsoleted by RFC 7230, RFC 7231, RFC 7232, RFC 7233, RFC 7234, RFC 7235) Summary: 1 error (**), 0 flaws (~~), 6 warnings (==), 7 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NFSv4 T. Haynes 3 Internet-Draft Primary Data 4 Intended status: Standards Track September 20, 2014 5 Expires: March 24, 2015 7 NFS Version 4 Minor Version 2 8 draft-ietf-nfsv4-minorversion2-27.txt 10 Abstract 12 This Internet-Draft describes NFS version 4 minor version two, 13 focusing mainly on the protocol extensions made from NFS version 4 14 minor version 0 and NFS version 4 minor version 1. Major extensions 15 introduced in NFS version 4 minor version two include: Server Side 16 Copy, Application I/O Advise, Space Reservations, Sparse Files, 17 Application Data Blocks, and Labeled NFS. 19 Requirements Language 21 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 22 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 23 document are to be interpreted as described in RFC 2119 [RFC2119]. 25 Status of This Memo 27 This Internet-Draft is submitted in full conformance with the 28 provisions of BCP 78 and BCP 79. 30 Internet-Drafts are working documents of the Internet Engineering 31 Task Force (IETF). Note that other groups may also distribute 32 working documents as Internet-Drafts. The list of current Internet- 33 Drafts is at http://datatracker.ietf.org/drafts/current/. 35 Internet-Drafts are draft documents valid for a maximum of six months 36 and may be updated, replaced, or obsoleted by other documents at any 37 time. It is inappropriate to use Internet-Drafts as reference 38 material or to cite them other than as "work in progress." 40 This Internet-Draft will expire on March 24, 2015. 42 Copyright Notice 44 Copyright (c) 2014 IETF Trust and the persons identified as the 45 document authors. All rights reserved. 47 This document is subject to BCP 78 and the IETF Trust's Legal 48 Provisions Relating to IETF Documents 49 (http://trustee.ietf.org/license-info) in effect on the date of 50 publication of this document. Please review these documents 51 carefully, as they describe your rights and restrictions with respect 52 to this document. Code Components extracted from this document must 53 include Simplified BSD License text as described in Section 4.e of 54 the Trust Legal Provisions and are provided without warranty as 55 described in the Simplified BSD License. 57 Table of Contents 59 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4 60 1.1. The NFS Version 4 Minor Version 2 Protocol . . . . . . . 4 61 1.2. Scope of This Document . . . . . . . . . . . . . . . . . 5 62 1.3. NFSv4.2 Goals . . . . . . . . . . . . . . . . . . . . . . 5 63 1.4. Overview of NFSv4.2 Features . . . . . . . . . . . . . . 5 64 1.4.1. Server Side Copy . . . . . . . . . . . . . . . . . . 5 65 1.4.2. Application I/O Advise . . . . . . . . . . . . . . . 6 66 1.4.3. Sparse Files . . . . . . . . . . . . . . . . . . . . 6 67 1.4.4. Space Reservation . . . . . . . . . . . . . . . . . . 6 68 1.4.5. Application Data Block (ADB) Support . . . . . . . . 6 69 1.4.6. Labeled NFS . . . . . . . . . . . . . . . . . . . . . 6 70 1.5. Differences from NFSv4.1 . . . . . . . . . . . . . . . . 7 71 2. Minor Versioning . . . . . . . . . . . . . . . . . . . . . . 7 72 3. pNFS considerations for New Operations . . . . . . . . . . . 10 73 3.1. Atomicity for ALLOCATE and DEALLOCATE . . . . . . . . . . 10 74 3.2. Sharing of stateids with NFSv4.1 . . . . . . . . . . . . 11 75 3.3. NFSv4.2 as a Storage Protocol in pNFS: the File Layout 76 Type . . . . . . . . . . . . . . . . . . . . . . . . . . 11 77 3.3.1. Operations Sent to NFSv4.2 Data Servers . . . . . . . 11 78 4. Server Side Copy . . . . . . . . . . . . . . . . . . . . . . 11 79 4.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 11 80 4.2. Protocol Overview . . . . . . . . . . . . . . . . . . . . 12 81 4.2.1. Copy Operations . . . . . . . . . . . . . . . . . . . 12 82 4.2.2. Requirements for Operations . . . . . . . . . . . . . 13 83 4.3. Requirements for Inter-Server Copy . . . . . . . . . . . 13 84 4.4. Implementation Considerations . . . . . . . . . . . . . . 14 85 4.4.1. Locking the Files . . . . . . . . . . . . . . . . . . 14 86 4.4.2. Client Caches . . . . . . . . . . . . . . . . . . . . 14 87 4.5. Intra-Server Copy . . . . . . . . . . . . . . . . . . . . 14 88 4.6. Inter-Server Copy . . . . . . . . . . . . . . . . . . . . 16 89 4.7. Server-to-Server Copy Protocol . . . . . . . . . . . . . 20 90 4.7.1. Considerations on Selecting a Copy Protocol . . . . . 20 91 4.7.2. Using NFSv4.x as the Copy Protocol . . . . . . . . . 20 92 4.7.3. Using an Alternative Copy Protocol . . . . . . . . . 20 93 4.8. netloc4 - Network Locations . . . . . . . . . . . . . . . 21 94 4.9. Copy Offload Stateids . . . . . . . . . . . . . . . . . . 22 95 4.10. Security Considerations . . . . . . . . . . . . . . . . . 22 96 4.10.1. Inter-Server Copy Security . . . . . . . . . . . . . 22 98 5. Support for Application IO Hints . . . . . . . . . . . . . . 32 99 6. Sparse Files . . . . . . . . . . . . . . . . . . . . . . . . 32 100 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 32 101 6.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 34 102 6.3. New Operations . . . . . . . . . . . . . . . . . . . . . 34 103 6.3.1. READ_PLUS . . . . . . . . . . . . . . . . . . . . . . 34 104 6.3.2. DEALLOCATE . . . . . . . . . . . . . . . . . . . . . 34 105 7. Space Reservation . . . . . . . . . . . . . . . . . . . . . . 34 106 7.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 35 107 8. Application Data Block Support . . . . . . . . . . . . . . . 37 108 8.1. Generic Framework . . . . . . . . . . . . . . . . . . . . 37 109 8.1.1. Data Block Representation . . . . . . . . . . . . . . 38 110 8.2. An Example of Detecting Corruption . . . . . . . . . . . 38 111 8.3. Example of READ_PLUS . . . . . . . . . . . . . . . . . . 40 112 8.4. An Example of Zeroing Space . . . . . . . . . . . . . . . 41 113 9. Labeled NFS . . . . . . . . . . . . . . . . . . . . . . . . . 41 114 9.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 41 115 9.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . 42 116 9.3. MAC Security Attribute . . . . . . . . . . . . . . . . . 42 117 9.3.1. Delegations . . . . . . . . . . . . . . . . . . . . . 43 118 9.3.2. Permission Checking . . . . . . . . . . . . . . . . . 43 119 9.3.3. Object Creation . . . . . . . . . . . . . . . . . . . 44 120 9.3.4. Existing Objects . . . . . . . . . . . . . . . . . . 44 121 9.3.5. Label Changes . . . . . . . . . . . . . . . . . . . . 44 122 9.4. pNFS Considerations . . . . . . . . . . . . . . . . . . . 44 123 9.5. Discovery of Server Labeled NFS Support . . . . . . . . . 45 124 9.6. MAC Security NFS Modes of Operation . . . . . . . . . . . 45 125 9.6.1. Full Mode . . . . . . . . . . . . . . . . . . . . . . 45 126 9.6.2. Guest Mode . . . . . . . . . . . . . . . . . . . . . 47 127 9.7. Security Considerations . . . . . . . . . . . . . . . . . 47 128 10. Sharing change attribute implementation details with NFSv4 129 clients . . . . . . . . . . . . . . . . . . . . . . . . . . . 48 130 10.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 48 131 11. Security Considerations . . . . . . . . . . . . . . . . . . . 48 132 12. Error Values . . . . . . . . . . . . . . . . . . . . . . . . 48 133 12.1. Error Definitions . . . . . . . . . . . . . . . . . . . 49 134 12.1.1. General Errors . . . . . . . . . . . . . . . . . . . 49 135 12.1.2. Server to Server Copy Errors . . . . . . . . . . . . 49 136 12.1.3. Labeled NFS Errors . . . . . . . . . . . . . . . . . 50 137 12.2. New Operations and Their Valid Errors . . . . . . . . . 50 138 12.3. New Callback Operations and Their Valid Errors . . . . . 54 139 13. New File Attributes . . . . . . . . . . . . . . . . . . . . . 54 140 13.1. New RECOMMENDED Attributes - List and Definition 141 References . . . . . . . . . . . . . . . . . . . . . . . 54 142 13.2. Attribute Definitions . . . . . . . . . . . . . . . . . 55 143 14. Operations: REQUIRED, RECOMMENDED, or OPTIONAL . . . . . . . 57 144 15. Modifications to NFSv4.1 Operations . . . . . . . . . . . . . 61 145 15.1. Operation 42: EXCHANGE_ID - Instantiate Client ID . . . 61 146 15.2. Operation 48: GETDEVICELIST - Get All Device Mappings 147 for a File System . . . . . . . . . . . . . . . . . . . 62 148 16. NFSv4.2 Operations . . . . . . . . . . . . . . . . . . . . . 63 149 16.1. Operation 59: ALLOCATE - Reserve Space in A Region of a 150 File . . . . . . . . . . . . . . . . . . . . . . . . . . 63 151 16.2. Operation 60: COPY - Initiate a server-side copy . . . . 64 152 16.3. Operation 61: COPY_NOTIFY - Notify a source server of a 153 future copy . . . . . . . . . . . . . . . . . . . . . . 69 154 16.4. Operation 62: DEALLOCATE - Unreserve Space in a Region 155 of a File . . . . . . . . . . . . . . . . . . . . . . . 70 156 16.5. Operation 63: IO_ADVISE - Application I/O access pattern 157 hints . . . . . . . . . . . . . . . . . . . . . . . . . 71 158 16.6. Operation 64: LAYOUTERROR - Provide Errors for the 159 Layout . . . . . . . . . . . . . . . . . . . . . . . . . 77 160 16.7. Operation 65: LAYOUTSTATS - Provide Statistics for the 161 Layout . . . . . . . . . . . . . . . . . . . . . . . . . 80 162 16.8. Operation 66: OFFLOAD_CANCEL - Stop an Offloaded 163 Operation . . . . . . . . . . . . . . . . . . . . . . . 81 164 16.9. Operation 67: OFFLOAD_STATUS - Poll for Status of 165 Asynchronous Operation . . . . . . . . . . . . . . . . . 82 166 16.10. Operation 68: READ_PLUS - READ Data or Holes from a File 83 167 16.11. Operation 69: SEEK - Find the Next Data or Hole . . . . 88 168 16.12. Operation 70: WRITE_SAME - WRITE an ADB Multiple Times 169 to a File . . . . . . . . . . . . . . . . . . . . . . . 89 170 17. NFSv4.2 Callback Operations . . . . . . . . . . . . . . . . . 92 171 17.1. Operation 15: CB_OFFLOAD - Report results of an 172 asynchronous operation . . . . . . . . . . . . . . . . . 92 173 18. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 94 174 19. References . . . . . . . . . . . . . . . . . . . . . . . . . 94 175 19.1. Normative References . . . . . . . . . . . . . . . . . . 94 176 19.2. Informative References . . . . . . . . . . . . . . . . . 94 177 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . 96 178 Appendix B. RFC Editor Notes . . . . . . . . . . . . . . . . . . 97 179 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 97 181 1. Introduction 183 1.1. The NFS Version 4 Minor Version 2 Protocol 185 The NFS version 4 minor version 2 (NFSv4.2) protocol is the third 186 minor version of the NFS version 4 (NFSv4) protocol. The first minor 187 version, NFSv4.0, is described in [I-D.ietf-nfsv4-rfc3530bis] and the 188 second minor version, NFSv4.1, is described in [RFC5661]. 190 As a minor version, NFSv4.2 is consistent with the overall goals for 191 NFSv4, but extends the protocol so as to better meet those goals, 192 based on experiences with NFSv4.1. In addition, NFSv4.2 has adopted 193 some additional goals, which motivate some of the major extensions in 194 NFSv4.2. 196 1.2. Scope of This Document 198 This document describes the NFSv4.2 protocol. With respect to 199 NFSv4.0 and NFSv4.1, this document does not: 201 o describe the NFSv4.0 or NFSv4.1 protocols, except where needed to 202 contrast with NFSv4.2 204 o modify the specification of the NFSv4.0 or NFSv4.1 protocols 206 o clarify the NFSv4.0 or NFSv4.1 protocols. I.e., any 207 clarifications made here apply to NFSv4.2 and neither of the prior 208 protocols 210 The full XDR for NFSv4.2 is presented in [NFSv42xdr]. 212 1.3. NFSv4.2 Goals 214 The goal of the design of NFSv4.2 is to take common local file system 215 features and offer them remotely. These features might 217 o already be available on the servers, e.g., sparse files 219 o be under development as a new standard, e.g., SEEK pulls in both 220 SEEK_HOLE and SEEK_DATA 222 o be used by clients with the servers via some proprietary means, 223 e.g., Labeled NFS 225 but the clients are not able to leverage them on the server within 226 the confines of the NFS protocol. 228 1.4. Overview of NFSv4.2 Features 230 1.4.1. Server Side Copy 232 A traditional file copy from one server to another results in the 233 data being put on the network twice - source to client and then 234 client to destination. New operations are introduced to allow the 235 client to authorize the two servers to interact directly. As this 236 copy can be lengthy, asynchronous support is also provided. 238 1.4.2. Application I/O Advise 240 Applications and clients want to advise the server as to expected I/O 241 behavior. Using IO_ADVISE (see Section 16.5) to communicate future I 242 /O behavior such as whether a file will be accessed sequentially or 243 randomly, and whether a file will or will not be accessed in the near 244 future, allows servers to optimize future I/O requests for a file by, 245 for example, prefetching or evicting data. This operation can be 246 used to support the posix_fadvise function as well as other 247 applications such as databases and video editors. 249 1.4.3. Sparse Files 251 Sparse files are ones which have unallocated or uninitialized data 252 blocks as holes in the file. Such holes are typically transferred as 253 0s during I/O. READ_PLUS (see Section 16.10) allows a server to send 254 back to the client metadata describing the hole and DEALLOCATE (see 255 Section 16.4) allows the client to punch holes into a file. In 256 addition, SEEK (see Section 16.11) is provided to scan for the next 257 hole or data from a given location. 259 1.4.4. Space Reservation 261 When a file is sparse, one concern applications have is ensuring that 262 there will always be enough data blocks available for the file during 263 future writes. ALLOCATE (see Section 16.1) allows a client to 264 request a guarantee that space will be available. And DEALLOCATE 265 (see Section 16.4) allows the client to punch a hole into a file, 266 thus releasing a space reservation. 268 1.4.5. Application Data Block (ADB) Support 270 Some applications treat a file as if it were a disk and as such want 271 to initialize (or format) the file image. We introduce WRITE_SAME 272 (see Section 16.12) to send this metadata to the server to allow it 273 to write the block contents. 275 1.4.6. Labeled NFS 277 While both clients and servers can employ Mandatory Access Control 278 (MAC) security models to enforce data access, there has been no 279 protocol support for interoperability. A new file object attribute, 280 sec_label (see Section 13.2.2) allows for the server to store MAC 281 labels on files, which the client retrieves and uses to enforce data 282 access (see Section 9.6.2). The format of the sec_label accommodates 283 any MAC security system. 285 1.5. Differences from NFSv4.1 287 In NFSv4.1, the only way to introduce new variants of an operation 288 was to introduce a new operation. I.e., READ becomes either READ2 or 289 READ_PLUS. With the use of discriminated unions as parameters to 290 such functions in NFSv4.2, it is possible to add a new arm in a 291 subsequent minor version. And it is also possible to move such an 292 operation from OPTIONAL/RECOMMENDED to REQUIRED. Forcing an 293 implementation to adopt each arm of a discriminated union at such a 294 time does not meet the spirit of the minor versioning rules. As 295 such, new arms of a discriminated union MUST follow the same 296 guidelines for minor versioning as operations in NFSv4.1 - i.e., they 297 may not be made REQUIRED. To support this, a new error code, 298 NFS4ERR_UNION_NOTSUPP, allows the server to communicate to the client 299 that the operation is supported, but the specific arm of the 300 discriminated union is not. 302 2. Minor Versioning 304 To address the requirement of an NFS protocol that can evolve as the 305 need arises, the NFSv4 protocol contains the rules and framework to 306 allow for future minor changes or versioning. 308 The base assumption with respect to minor versioning is that any 309 future accepted minor version will be documented in one or more 310 Standards Track RFCs. Minor version 0 of the NFSv4 protocol is 311 represented by [I-D.ietf-nfsv4-rfc3530bis], minor version 1 by 312 [RFC5661], and minor version 2 by this document. The COMPOUND and 313 CB_COMPOUND procedures support the encoding of the minor version 314 being requested by the client. 316 The following items represent the basic rules for the development of 317 minor versions. Note that a future minor version may modify or add 318 to the following rules as part of the minor version definition. 320 1. Procedures are not added or deleted. 322 To maintain the general RPC model, NFSv4 minor versions will not 323 add to or delete procedures from the NFS program. 325 2. Minor versions may add operations to the COMPOUND and 326 CB_COMPOUND procedures. 328 The addition of operations to the COMPOUND and CB_COMPOUND 329 procedures does not affect the RPC model. 331 * Minor versions may append attributes to the bitmap4 that 332 represents sets of attributes and to the fattr4 that 333 represents sets of attribute values. 335 This allows for the expansion of the attribute model to allow 336 for future growth or adaptation. 338 * Minor version X must append any new attributes after the last 339 documented attribute. 341 Since attribute results are specified as an opaque array of 342 per-attribute, XDR-encoded results, the complexity of adding 343 new attributes in the midst of the current definitions would 344 be too burdensome. 346 3. Minor versions must not modify the structure of an existing 347 operation's arguments or results. 349 Again, the complexity of handling multiple structure definitions 350 for a single operation is too burdensome. New operations should 351 be added instead of modifying existing structures for a minor 352 version. 354 This rule does not preclude the following adaptations in a minor 355 version: 357 * adding bits to flag fields, such as new attributes to 358 GETATTR's bitmap4 data type, and providing corresponding 359 variants of opaque arrays, such as a notify4 used together 360 with such bitmaps 362 * adding bits to existing attributes like ACLs that have flag 363 words 365 * extending enumerated types (including NFS4ERR_*) with new 366 values 368 * adding cases to a switched union 370 4. Note that when adding new cases to a switched union, a minor 371 version must not make new cases be REQUIRED. While the 372 encapsulating operation may be REQUIRED, the new cases (the 373 specific arm of the discriminated union) is not. The error code 374 NFS4ERR_UNION_NOTSUPP is used to notify the client when the 375 server does not support such a case. 377 5. Minor versions must not modify the structure of existing 378 attributes. 380 6. Minor versions must not delete operations. 382 This prevents the potential reuse of a particular operation 383 "slot" in a future minor version. 385 7. Minor versions must not delete attributes. 387 8. Minor versions must not delete flag bits or enumeration values. 389 9. Minor versions may declare an operation MUST NOT be implemented. 391 Specifying that an operation MUST NOT be implemented is 392 equivalent to obsoleting an operation. For the client, it means 393 that the operation MUST NOT be sent to the server. For the 394 server, an NFS error can be returned as opposed to "dropping" 395 the request as an XDR decode error. This approach allows for 396 the obsolescence of an operation while maintaining its structure 397 so that a future minor version can reintroduce the operation. 399 1. Minor versions may declare that an attribute MUST NOT be 400 implemented. 402 2. Minor versions may declare that a flag bit or enumeration 403 value MUST NOT be implemented. 405 10. Minor versions may declare an operation to be OBSOLESCENT, which 406 indicates an intention to remove the operation (i.e., make it 407 MANDATORY TO NOT implement) in a subsequent minor version. Such 408 labeling is separate from the question of whether the operation 409 is REQUIRED or RECOMMENDED or OPTIONAL in the current minor 410 version. An operation may be both REQUIRED for the given minor 411 version and marked OBSOLESCENT, with the expectation that it 412 will be MANDATORY TO NOT implement in the next (or other 413 subsequent) minor version. 415 11. Note that the early notification of operation obsolescence is 416 put in place to mitigate the effects of design and 417 implementation mistakes, and to allow protocol development to 418 adapt to unexpected changes in the pace of implementation. Even 419 if an operation is marked OBSOLESCENT in a given minor version, 420 it may end up not being marked MANDATORY TO NOT implement in the 421 next minor version. In unusual circumstances, it might not be 422 marked OBSOLESCENT in a subsequent minor version, and never 423 become MANDATORY TO NOT implement. 425 12. Minor versions may downgrade features from REQUIRED to 426 RECOMMENDED, from RECOMMENDED to OPTIONAL, or from OPTIONAL to 427 MANDATORY TO NOT implement. Also, if a feature was marked as 428 OBSOLESCENT in the prior minor version, it may be downgraded 429 from REQUIRED to OPTIONAL from RECOMMENDED to MANDATORY TO NOT 430 implement, or from REQUIRED to MANDATORY TO NOT implement. 432 13. Minor versions may upgrade features from OPTIONAL to 433 RECOMMENDED, or RECOMMENDED to REQUIRED. Also, if a feature was 434 marked as OBSOLESCENT in the prior minor version, it may be 435 upgraded to not be OBSOLESCENT. 437 14. A client and server that support minor version X SHOULD support 438 minor versions 0 through X-1 as well. 440 15. Except for infrastructural changes, a minor version must not 441 introduce REQUIRED new features. 443 This rule allows for the introduction of new functionality and 444 forces the use of implementation experience before designating a 445 feature as REQUIRED. On the other hand, some classes of 446 features are infrastructural and have broad effects. Allowing 447 infrastructural features to be RECOMMENDED or OPTIONAL 448 complicates implementation of the minor version. 450 16. Unless explicitly documented in a minor version standard's 451 document, a client MUST NOT attempt to use a stateid, 452 filehandle, or similar returned object from the COMPOUND 453 procedure with minor version X for another COMPOUND procedure 454 with minor version Y, where X != Y. 456 3. pNFS considerations for New Operations 458 3.1. Atomicity for ALLOCATE and DEALLOCATE 460 Both ALLOCATE (see Section 16.1) and DEALLOCATE (see Section 16.4) 461 are sent to the metadata server, which is responsible for 462 coordinating the changes onto the storage devices. In particular, 463 both operations must either fully succeed or fail, it cannot be the 464 case that one storage device succeeds whilst another fails. 466 3.2. Sharing of stateids with NFSv4.1 468 A NFSv4.2 metadata server can hand out a layout to a NFSv4.1 storage 469 device. Section 13.9.1 of [RFC5661] discusses how the client gets a 470 stateid from the metadata server to present to a storage device. 472 3.3. NFSv4.2 as a Storage Protocol in pNFS: the File Layout Type 474 A file layout provided by a NFSv4.2 server may refer either to a 475 storage device that only implements NFSv4.1 as specified in 476 [RFC5661], or to a storage device that implements additions from 477 NFSv4.2, in which case the rules in Section 3.3.1 apply. As the File 478 Layout Type does not provide a means for informing the client as to 479 which minor version a particular storage device is providing, it will 480 have to negotiate this via the normal RPC semantics of major and 481 minor version discovery. 483 3.3.1. Operations Sent to NFSv4.2 Data Servers 485 In addition to the commands listed in [RFC5661], NFSv4.2 data servers 486 MAY accept a COMPOUND containing the following additional operations: 487 IO_ADVISE (see Section 16.5), READ_PLUS (see Section 16.10), 488 WRITE_SAME (see Section 16.12), and SEEK (see Section 16.11), which 489 will be treated like the subset specified as "Operations Sent to 490 NFSv4.1 Data Servers" in Section 13.6 of [RFC5661]. 492 Additional details on the implementation of these operations in a 493 pNFS context are documented in the operation specific sections. 495 4. Server Side Copy 497 4.1. Introduction 499 The server-side copy feature provides a mechanism for the NFS client 500 to perform a file copy on a server or between two servers without the 501 data being transmitted back and forth over the network through the 502 NFS client. Without this feature, an NFS client copies data from one 503 location to another by reading the data from the source server over 504 the network, and then writing the data back over the network to the 505 destination server. 507 If the source object and destination object are on different file 508 servers, the file servers will communicate with one another to 509 perform the copy operation. The server-to-server protocol by which 510 this is accomplished is not defined in this document. 512 4.2. Protocol Overview 514 The server-side copy offload operations support both intra-server and 515 inter-server file copies. An intra-server copy is a copy in which 516 the source file and destination file reside on the same server. In 517 an inter-server copy, the source file and destination file are on 518 different servers. In both cases, the copy may be performed 519 synchronously or asynchronously. 521 Throughout the rest of this document, we refer to the NFS server 522 containing the source file as the "source server" and the NFS server 523 to which the file is transferred as the "destination server". In the 524 case of an intra-server copy, the source server and destination 525 server are the same server. Therefore in the context of an intra- 526 server copy, the terms source server and destination server refer to 527 the single server performing the copy. 529 The new operations are designed to copy files. Other file system 530 objects can be copied by building on these operations or using other 531 techniques. For example, if the user wishes to copy a directory, the 532 client can synthesize a directory copy by first creating the 533 destination directory and then copying the source directory's files 534 to the new destination directory. 536 For the inter-server copy, the operations are defined to be 537 compatible with the traditional copy authentication approach. The 538 client and user are authorized at the source for reading. Then they 539 are authorized at the destination for writing. 541 4.2.1. Copy Operations 543 COPY_NOTIFY: Used by the client to notify the source server of a 544 future file copy from a given destination server for the given 545 user. (Section 16.3) 547 COPY: Used by the client to request a file copy. (Section 16.2) 549 OFFLOAD_CANCEL: Used by the client to terminate an asynchronous file 550 copy. (Section 16.8) 552 OFFLOAD_STATUS: Used by the client to poll the status of an 553 asynchronous file copy. (Section 16.9) 555 CB_OFFLOAD: Used by the destination server to report the results of 556 an asynchronous file copy to the client. (Section 17.1) 558 4.2.2. Requirements for Operations 560 The implementation of server-side copy is OPTIONAL by the client and 561 the server. However, in order to successfully copy a file, some 562 operations MUST be supported by the client and/or server. 564 If a client desires an intra-server file copy, then it MUST support 565 the COPY and CB_OFFLOAD operations. If COPY returns a stateid, then 566 the client MAY use the OFFLOAD_CANCEL and OFFLOAD_STATUS operations. 568 If a client desires an inter-server file copy, then it MUST support 569 the COPY, COPY_NOTICE, and CB_OFFLOAD operations, and MAY use the 570 OFFLOAD_CANCEL operation. If COPY returns a stateid, then the client 571 MAY use the OFFLOAD_CANCEL and OFFLOAD_STATUS operations. 573 If a server supports intra-server copy, then the server MUST support 574 the COPY operation. If a server's COPY operation returns a stateid, 575 then the server MUST also support these operations: CB_OFFLOAD, 576 OFFLOAD_CANCEL, and OFFLOAD_STATUS. 578 If a source server supports inter-server copy, then the source server 579 MUST support all these operations: COPY_NOTIFY and OFFLOAD_CANCEL. 580 If a destination server supports inter-server copy, then the 581 destination server MUST support the COPY operation. If a destination 582 server's COPY operation returns a stateid, then the destination 583 server MUST also support these operations: CB_OFFLOAD, 584 OFFLOAD_CANCEL, COPY_NOTIFY, and OFFLOAD_STATUS. 586 Each operation is performed in the context of the user identified by 587 the ONC RPC credential of its containing COMPOUND or CB_COMPOUND 588 request. For example, an OFFLOAD_CANCEL operation issued by a given 589 user indicates that a specified COPY operation initiated by the same 590 user be canceled. Therefore an OFFLOAD_CANCEL MUST NOT interfere 591 with a copy of the same file initiated by another user. 593 An NFS server MAY allow an administrative user to monitor or cancel 594 copy operations using an implementation specific interface. 596 4.3. Requirements for Inter-Server Copy 598 Inter-server copy is driven by several requirements: 600 o The specification MUST NOT mandate the server-to-server protocol. 602 o The specification MUST provide guidance for using NFSv4.x as a 603 copy protocol. For those source and destination servers willing 604 to use NFSv4.x, there are specific security considerations that 605 this specification MUST address. 607 o The specification MUST NOT mandate preconfiguration between the 608 source and destination server. Requiring that the source and 609 destination first have a "copying relationship" increases the 610 administrative burden. However the specification MUST NOT 611 preclude implementations that require preconfiguration. 613 o The specification MUST NOT mandate a trust relationship between 614 the source and destination server. The NFSv4 security model 615 requires mutual authentication between a principal on an NFS 616 client and a principal on an NFS server. This model MUST continue 617 with the introduction of COPY. 619 4.4. Implementation Considerations 621 4.4.1. Locking the Files 623 Both the source and destination file may need to be locked to protect 624 the content during the copy operations. A client can achieve this by 625 a combination of OPEN and LOCK operations. I.e., either share or 626 byte range locks might be desired. 628 Note that when the client establishes a lock stateid on the source, 629 the context of that stateid is for the client and not the 630 destination. As such, there might already be an outstanding stateid, 631 issued to the destination as client of the source, with the same 632 value as that provided for the lock stateid. The source MUST equate 633 the lock stateid as that of the client, i.e., when the destination 634 presents it in the context of a inter-server copy, it is on behalf of 635 the client. 637 4.4.2. Client Caches 639 In a traditional copy, if the client is in the process of writing to 640 the file before the copy (and perhaps with a write delegation), it 641 will be straightforward to update the destination server. With an 642 inter-server copy, the source has no insight into the changes cached 643 on the client. The client SHOULD write back the data to the source 644 or be prepared for the destination to get a corrupt copy of the file. 646 4.5. Intra-Server Copy 648 To copy a file on a single server, the client uses a COPY operation. 649 The server may respond to the copy operation with the final results 650 of the copy or it may perform the copy asynchronously and deliver the 651 results using a CB_OFFLOAD operation callback. If the copy is 652 performed asynchronously, the client may poll the status of the copy 653 using OFFLOAD_STATUS or cancel the copy using OFFLOAD_CANCEL. 655 A synchronous intra-server copy is shown in Figure 1. In this 656 example, the NFS server chooses to perform the copy synchronously. 657 The copy operation is completed, either successfully or 658 unsuccessfully, before the server replies to the client's request. 659 The server's reply contains the final result of the operation. 661 Client Server 662 + + 663 | | 664 |--- OPEN ---------------------------->| Client opens 665 |<------------------------------------/| the source file 666 | | 667 |--- OPEN ---------------------------->| Client opens 668 |<------------------------------------/| the destination file 669 | | 670 |--- COPY ---------------------------->| Client requests 671 |<------------------------------------/| a file copy 672 | | 673 |--- CLOSE --------------------------->| Client closes 674 |<------------------------------------/| the destination file 675 | | 676 |--- CLOSE --------------------------->| Client closes 677 |<------------------------------------/| the source file 678 | | 679 | | 681 Figure 1: A synchronous intra-server copy. 683 An asynchronous intra-server copy is shown in Figure 2. In this 684 example, the NFS server performs the copy asynchronously. The 685 server's reply to the copy request indicates that the copy operation 686 was initiated and the final result will be delivered at a later time. 687 The server's reply also contains a copy stateid. The client may use 688 this copy stateid to poll for status information (as shown) or to 689 cancel the copy using an OFFLOAD_CANCEL. When the server completes 690 the copy, the server performs a callback to the client and reports 691 the results. 693 Client Server 694 + + 695 | | 696 |--- OPEN ---------------------------->| Client opens 697 |<------------------------------------/| the source file 698 | | 699 |--- OPEN ---------------------------->| Client opens 700 |<------------------------------------/| the destination file 701 | | 702 |--- COPY ---------------------------->| Client requests 703 |<------------------------------------/| a file copy 704 | | 705 | | 706 |--- OFFLOAD_STATUS ------------------>| Client may poll 707 |<------------------------------------/| for status 708 | | 709 | . | Multiple OFFLOAD_STATUS 710 | . | operations may be sent. 711 | . | 712 | | 713 |<-- CB_OFFLOAD -----------------------| Server reports results 714 |\------------------------------------>| 715 | | 716 |--- CLOSE --------------------------->| Client closes 717 |<------------------------------------/| the destination file 718 | | 719 |--- CLOSE --------------------------->| Client closes 720 |<------------------------------------/| the source file 721 | | 722 | | 724 Figure 2: An asynchronous intra-server copy. 726 4.6. Inter-Server Copy 728 A copy may also be performed between two servers. The copy protocol 729 is designed to accommodate a variety of network topologies. As shown 730 in Figure 3, the client and servers may be connected by multiple 731 networks. In particular, the servers may be connected by a 732 specialized, high speed network (network 192.0.2.0/24 in the diagram) 733 that does not include the client. The protocol allows the client to 734 setup the copy between the servers (over network 203.0.113.0/24 in 735 the diagram) and for the servers to communicate on the high speed 736 network if they choose to do so. 738 192.0.2.0/24 739 +-------------------------------------+ 740 | | 741 | | 742 | 192.0.2.18 | 192.0.2.56 743 +-------+------+ +------+------+ 744 | Source | | Destination | 745 +-------+------+ +------+------+ 746 | 203.0.113.18 | 203.0.113.56 747 | | 748 | | 749 | 203.0.113.0/24 | 750 +------------------+------------------+ 751 | 752 | 753 | 203.0.113.243 754 +-----+-----+ 755 | Client | 756 +-----------+ 758 Figure 3: An example inter-server network topology. 760 For an inter-server copy, the client notifies the source server that 761 a file will be copied by the destination server using a COPY_NOTIFY 762 operation. The client then initiates the copy by sending the COPY 763 operation to the destination server. The destination server may 764 perform the copy synchronously or asynchronously. 766 A synchronous inter-server copy is shown in Figure 4. In this case, 767 the destination server chooses to perform the copy before responding 768 to the client's COPY request. 770 An asynchronous copy is shown in Figure 5. In this case, the 771 destination server chooses to respond to the client's COPY request 772 immediately and then perform the copy asynchronously. 774 Client Source Destination 775 + + + 776 | | | 777 |--- OPEN --->| | Returns os1 778 |<------------------/| | 779 | | | 780 |--- COPY_NOTIFY --->| | 781 |<------------------/| | 782 | | | 783 |--- OPEN ---------------------------->| Returns os2 784 |<------------------------------------/| 785 | | | 786 |--- COPY ---------------------------->| 787 | | | 788 | | | 789 | |<----- read -----| 790 | |\--------------->| 791 | | | 792 | | . | Multiple reads may 793 | | . | be necessary 794 | | . | 795 | | | 796 | | | 797 |<------------------------------------/| Destination replies 798 | | | to COPY 799 | | | 800 |--- CLOSE --------------------------->| Release open state 801 |<------------------------------------/| 802 | | | 803 |--- CLOSE --->| | Release open state 804 |<------------------/| | 806 Figure 4: A synchronous inter-server copy. 808 Client Source Destination 809 + + + 810 | | | 811 |--- OPEN --->| | Returns os1 812 |<------------------/| | 813 | | | 814 |--- LOCK --->| | Optional, could be done 815 |<------------------/| | with a share lock 816 | | | 817 |--- COPY_NOTIFY --->| | Need to pass in 818 |<------------------/| | os1 or lock state 819 | | | 820 | | | 821 | | | 822 |--- OPEN ---------------------------->| Returns os2 823 |<------------------------------------/| 824 | | | 825 |--- LOCK ---------------------------->| Optional ... 826 |<------------------------------------/| 827 | | | 828 |--- COPY ---------------------------->| Need to pass in 829 |<------------------------------------/| os2 or lock state 830 | | | 831 | | | 832 | |<----- read -----| 833 | |\--------------->| 834 | | | 835 | | . | Multiple reads may 836 | | . | be necessary 837 | | . | 838 | | | 839 | | | 840 |--- OFFLOAD_STATUS ------------------>| Client may poll 841 |<------------------------------------/| for status 842 | | | 843 | | . | Multiple OFFLOAD_STATUS 844 | | . | operations may be sent 845 | | . | 846 | | | 847 | | | 848 | | | 849 |<-- CB_OFFLOAD -----------------------| Destination reports 850 |\------------------------------------>| results 851 | | | 852 |--- LOCKU --------------------------->| Only if LOCK was done 853 |<------------------------------------/| 854 | | | 855 |--- CLOSE --------------------------->| Release open state 856 |<------------------------------------/| 857 | | | 858 |--- LOCKU --->| | Only if LOCK was done 859 |<------------------/| | 860 | | | 861 |--- CLOSE --->| | Release open state 862 |<------------------/| | 863 | | | 865 Figure 5: An asynchronous inter-server copy. 867 4.7. Server-to-Server Copy Protocol 869 The choice of what protocol to use in an inter-server copy is 870 ultimately the destination server's decision. However, the 871 destination server has to be cognizant that it is working on behalf 872 of the client. 874 4.7.1. Considerations on Selecting a Copy Protocol 876 The client can have requirements over both the size of transactions 877 and error recovery semantics. It may want to split the copy up such 878 that each chunk is synchronously transferred. It may want the copy 879 protocol to copy the bytes in consecutive order such that upon an 880 error, the client can restart the copy at the last known good offset. 881 If the destination server cannot meet these requirements, the client 882 may prefer the traditional copy mechanism such that it can meet those 883 requirements. 885 4.7.2. Using NFSv4.x as the Copy Protocol 887 The destination server MAY use standard NFSv4.x (where x >= 1) 888 operations to read the data from the source server. If NFSv4.x is 889 used for the server-to-server copy protocol, the destination server 890 can use the source filehandle and ca_src_stateid provided in the COPY 891 request with standard NFSv4.x operations to read data from the source 892 server. 894 4.7.3. Using an Alternative Copy Protocol 896 In a homogeneous environment, the source and destination servers 897 might be able to perform the file copy extremely efficiently using 898 specialized protocols. For example the source and destination 899 servers might be two nodes sharing a common file system format for 900 the source and destination file systems. Thus the source and 901 destination are in an ideal position to efficiently render the image 902 of the source file to the destination file by replicating the file 903 system formats at the block level. Another possibility is that the 904 source and destination might be two nodes sharing a common storage 905 area network, and thus there is no need to copy any data at all, and 906 instead ownership of the file and its contents might simply be re- 907 assigned to the destination. To allow for these possibilities, the 908 destination server is allowed to use a server-to-server copy protocol 909 of its choice. 911 In a heterogeneous environment, using a protocol other than NFSv4.x 912 (e.g., HTTP [RFC2616] or FTP [RFC959]) presents some challenges. In 913 particular, the destination server is presented with the challenge of 914 accessing the source file given only an NFSv4.x filehandle. 916 One option for protocols that identify source files with path names 917 is to use an ASCII hexadecimal representation of the source 918 filehandle as the file name. 920 Another option for the source server is to use URLs to direct the 921 destination server to a specialized service. For example, the 922 response to COPY_NOTIFY could include the URL ftp:// 923 s1.example.com:9999/_FH/0x12345, where 0x12345 is the ASCII 924 hexadecimal representation of the source filehandle. When the 925 destination server receives the source server's URL, it would use 926 "_FH/0x12345" as the file name to pass to the FTP server listening on 927 port 9999 of s1.example.com. On port 9999 there would be a special 928 instance of the FTP service that understands how to convert NFS 929 filehandles to an open file descriptor (in many operating systems, 930 this would require a new system call, one which is the inverse of the 931 makefh() function that the pre-NFSv4 MOUNT service needs). 933 Authenticating and identifying the destination server to the source 934 server is also a challenge. Recommendations for how to accomplish 935 this are given in Section 4.10.1.3. 937 4.8. netloc4 - Network Locations 939 The server-side copy operations specify network locations using the 940 netloc4 data type shown below: 942 enum netloc_type4 { 943 NL4_NAME = 0, 944 NL4_URL = 1, 945 NL4_NETADDR = 2 946 }; 947 union netloc4 switch (netloc_type4 nl_type) { 948 case NL4_NAME: utf8str_cis nl_name; 949 case NL4_URL: utf8str_cis nl_url; 950 case NL4_NETADDR: netaddr4 nl_addr; 951 }; 953 If the netloc4 is of type NL4_NAME, the nl_name field MUST be 954 specified as a UTF-8 string. The nl_name is expected to be resolved 955 to a network address via DNS, LDAP, NIS, /etc/hosts, or some other 956 means. If the netloc4 is of type NL4_URL, a server URL [RFC3986] 957 appropriate for the server-to-server copy operation is specified as a 958 UTF-8 string. If the netloc4 is of type NL4_NETADDR, the nl_addr 959 field MUST contain a valid netaddr4 as defined in Section 3.3.9 of 960 [RFC5661]. 962 When netloc4 values are used for an inter-server copy as shown in 963 Figure 3, their values may be evaluated on the source server, 964 destination server, and client. The network environment in which 965 these systems operate should be configured so that the netloc4 values 966 are interpreted as intended on each system. 968 4.9. Copy Offload Stateids 970 A server may perform a copy offload operation asynchronously. An 971 asynchronous copy is tracked using a copy offload stateid. Copy 972 offload stateids are included in the COPY, OFFLOAD_CANCEL, 973 OFFLOAD_STATUS, and CB_OFFLOAD operations. 975 A copy offload stateid will be valid until either (A) the client or 976 server restarts or (B) the client returns the resource by issuing a 977 OFFLOAD_CANCEL operation or the client replies to a CB_OFFLOAD 978 operation. 980 A copy offload stateid's seqid MUST NOT be 0. In the context of a 981 copy offload operation, it is ambiguous to indicate the most recent 982 copy offload operation using a stateid with seqid of 0. Therefore a 983 copy offload stateid with seqid of 0 MUST be considered invalid. 985 4.10. Security Considerations 987 The security considerations pertaining to NFSv4.1 [RFC5661] apply to 988 this section. And as such, the standard security mechanisms used by 989 the protocol can be used to secure the server-to-server operations. 991 NFSv4 clients and servers supporting the inter-server copy operations 992 described in this chapter are REQUIRED to implement the mechanism 993 described in Section 4.10.1.1, and to support rejecting COPY_NOTIFY 994 requests that do not use RPCSEC_GSS with privacy. If the server-to- 995 server copy protocol is ONC RPC based, the servers are also REQUIRED 996 to implement [rpcsec_gssv3] including the RPCSEC_GSSv3 copy_to_auth, 997 copy_from_auth, and copy_confirm_auth structured privileges. This 998 requirement to implement is not a requirement to use; for example, a 999 server may depending on configuration also allow COPY_NOTIFY requests 1000 that use only AUTH_SYS. 1002 4.10.1. Inter-Server Copy Security 1004 4.10.1.1. Inter-Server Copy via ONC RPC with RPCSEC_GSSv3 1006 When the client sends a COPY_NOTIFY to the source server to expect 1007 the destination to attempt to copy data from the source server, it is 1008 expected that this copy is being done on behalf of the principal 1009 (called the "user principal") that sent the RPC request that encloses 1010 the COMPOUND procedure that contains the COPY_NOTIFY operation. The 1011 user principal is identified by the RPC credentials. A mechanism 1012 that allows the user principal to authorize the destination server to 1013 perform the copy, that lets the source server properly authenticate 1014 the destination's copy, and does not allow the destination server to 1015 exceed this authorization, is necessary. 1017 An approach that sends delegated credentials of the client's user 1018 principal to the destination server is not used for the following 1019 reason. If the client's user delegated its credentials, the 1020 destination would authenticate as the user principal. If the 1021 destination were using the NFSv4 protocol to perform the copy, then 1022 the source server would authenticate the destination server as the 1023 user principal, and the file copy would securely proceed. However, 1024 this approach would allow the destination server to copy other files. 1025 The user principal would have to trust the destination server to not 1026 do so. This is counter to the requirements, and therefore is not 1027 considered. 1029 Instead, a combination of two features of the RPCSEC_GSSv3 1030 [rpcsec_gssv3] protocol can be used: compound authentication and RPC 1031 application defined structured privilege assertions. These features 1032 allow the destination server to authenticate to the source server as 1033 acting on behalf of the user principal, and to authorize the 1034 destination server to perform READs of the file to be copied from the 1035 source on behalf of the user principal. Once the copy is complete, 1036 the client can destroy the RPCSEC_GSSv3 handles to end the 1037 authorization of both the source and destination servers to copy. 1039 RPCSEC_GSSv3 introduces the notion of RPC application defined 1040 structured privileges. We define three structured privileges that 1041 work in tandem to authorize the copy: 1043 copy_from_auth: A user principal is authorizing a source principal 1044 ("nfs@") to allow a destination principal 1045 ("nfs@") to setup the copy_confirm_auth privilege 1046 required to copy a file from the source to the destination on 1047 behalf of the user principal. This privilege is established on 1048 the source server before the user principal sends a COPY_NOTIFY 1049 operation to the source server, and the resultant RPCSEC_GSSv3 1050 context is used to secure the COPY_NOTIFY operation. 1052 struct copy_from_auth_priv { 1053 secret4 cfap_shared_secret; 1054 netloc4 cfap_destination; 1055 /* the NFSv4 user name that the user principal maps to */ 1056 utf8str_mixed cfap_username; 1057 }; 1058 cfp_shared_secret is an automatically generated random number 1059 secret value. 1061 copy_to_auth: A user principal is authorizing a destination 1062 principal ("nfs@") to setup a copy_confirm_auth 1063 privilege with a source principal ("nfs@") to allow it to 1064 copy a file from the source to the destination on behalf of the 1065 user principal. This privilege is established on the destination 1066 server before the user principal sends a COPY operation to the 1067 destination server, and the resultant RPCSEC_GSSv3 context is used 1068 to secure the COPY operation. 1070 struct copy_to_auth_priv { 1071 /* equal to cfap_shared_secret */ 1072 secret4 ctap_shared_secret; 1073 netloc4 ctap_source; 1074 /* the NFSv4 user name that the user principal maps to */ 1075 utf8str_mixed ctap_username; 1076 /* 1077 * user principal RPCSEC_GSSv1 (or v2) handle shared 1078 * with the source server 1079 */ 1080 opaque ctap_handle<>; 1081 int ctap_handle_vers; 1082 /* A nounce and a mic of the nounce using ctap_handle */ 1083 opaque ctap_nounce<>; 1084 opaque ctap_nounce_mic<>; 1085 }; 1087 ctap_shared_secret is the automatically generated secret value 1088 used to establish the copy_from_auth privilege with the source 1089 principal. ctap_handle, ctap_handle_vers, ctap_nounce, and 1090 ctap_nounce_mic are used to construct the compound authentication 1091 portion of the copy_confirm_auth RPCSEC_GSSv3 context between the 1092 destination server and the source server (See Section 4.10.1.1.1). 1094 copy_confirm_auth: A destination principal ("nfs@") is 1095 confirming with the source principal ("nfs@") that it is 1096 authorized to copy data from the source. Note that besides the 1097 rpc_gss3_privs payload (struct copy_confirm_auth_priv), the 1098 copy_confirm_auth RPCSEC_GSS3_CREATE message also contains an 1099 rpc_gss3_gss_binding payload so that the copy is done on behalf of 1100 the user principal. This privilege is established on the 1101 destination server before the file is copied from the source to 1102 the destination. The resultant RPCSEC_GSSv3 context is used to 1103 secure the READ operations from the source to the destination 1104 server. 1106 struct copy_confirm_auth_priv { 1107 /* equal to GSS_GetMIC() of cfap_shared_secret */ 1108 opaque ccap_shared_secret_mic<>; 1109 /* the NFSv4 user name that the user principal maps to */ 1110 utf8str_mixed ccap_username; 1111 }; 1113 4.10.1.1.1. Establishing a Security Context 1115 The RPCSEC_GSSv3 compound authentication feature allows a server to 1116 act on behalf of a user if the server identifies the user and trusts 1117 the client. In the inter-server server side copy case, the server is 1118 the source server, and the client is the destination server acting as 1119 a client when performing the copy. 1121 The user principal is not required (nor expected) to have an 1122 RPCSEC_GSS secured connection and context between the destination 1123 server (acting as a client) and the source server. The user 1124 principal does have an RPCSEC_GSS secured connection and context 1125 between the client and the source server established for the OPEN of 1126 the file to be copied. 1128 We use the RPCSEC_GSS context established between the user principal 1129 and the source server to OPEN the file to be copied to provide the 1130 the necessary user principal identification to the source server from 1131 the destination server (acting as a client). This is accomplished by 1132 sending the user principal identification information: e.g., the 1133 rpc_gss3_gss_binding fields, in the copy_to_auth privilege 1134 established between the client and the destination server. This same 1135 information is then placed in the rpc_gss3_gss_binding fields of the 1136 copy_confirm_auth RPCSEC_GSS3_CREATE message sent from the 1137 destination server (acting as a client) to the source server. 1139 When the user principal wants to COPY a file between two servers, if 1140 it has not established copy_from_auth and copy_to_auth privileges on 1141 the servers, it establishes them: 1143 o As noted in [rpcsec_gssv3] the client uses an existing 1144 RPCSEC_GSSv1 (or v2) context termed the "parent" handle to 1145 establish and protect RPCSEC_GSSv3 exchanges. The copy_from_auth 1146 privilege will use the context established between the user 1147 principal and the source server used to OPEN the source file as 1148 the RPCSEC_GSSv3 parent handle. The copy_to_auth privilege will 1149 use the context established between the user principal and the 1150 destination server used to OPEN the destination file as the 1151 RPCSEC_GSSv3 parent handle. 1153 o A random number is generated to use as a secret to be shared 1154 between the two servers. This shared secret will be placed in the 1155 cfap_shared_secret and ctap_shared_secret fields of the 1156 appropriate privilege data types, copy_from_auth_priv and 1157 copy_to_auth_priv. Because of this shared_secret the 1158 RPCSEC_GSS3_CREATE control messages for copy_from_auth and 1159 copy_to_auth MUST use a QOP of rpc_gss_svc_privacy. 1161 o An instance of copy_from_auth_priv is filled in with the shared 1162 secret, the destination server, and the NFSv4 user id of the user 1163 principal and is placed in rpc_gss3_create_args 1164 assertions[0].assertion.privs.privilege. The string 1165 "copy_from_auth" is placed in assertions[0].assertion.privs.name. 1166 The field assertions[0].critical is set to TRUE. The source 1167 server unwraps the rpc_gss_svc_privacy RPCSEC_GSS3_CREATE payload 1168 and verifies that the NFSv4 user id being asserted matches the 1169 source server's mapping of the user principal. If it does, the 1170 privilege is established on the source server as: 1171 <"copy_from_auth", user id, destination>. The field "handle" in a 1172 successful reply is the RPCSEC_GSSv3 "child" handle that the 1173 client will use on COPY_NOTIFY requests to the source server 1174 involving the destination server. 1175 granted_assertions[0].assertion.privs.name will be equal to 1176 "copy_from_auth". 1178 o An instance of copy_to_auth_priv is filled in with the shared 1179 secret, the cnr_source_server list returned by COPY_NOTIFY, and 1180 the NFSv4 user id of the user principal. The next four fields are 1181 passed in the copy_to_auth privilege to be used by the 1182 copy_confirm_auth rpc_gss3_gss_binding fields as explained above. 1183 A nounce is created, and GSS_MIC() is invoked on the nounce using 1184 the RPCSEC_GSSv1 (or v2) context shared between user principal and 1185 the source server. The nounce, nounce MIC, context handle used to 1186 create the nounce MIC, and the context handle version are added to 1187 the copy_to_auth_priv instance which is placed in 1188 rpc_gss3_create_args assertions[0].assertion.privs.privilege. The 1189 string "copy_to_auth" is placed in 1190 assertions[0].assertion.privs.name. The field 1191 assertions[0].critical is set to TRUE. The destination server 1192 unwraps the rpc_gss_svc_privacy RPCSEC_GSS3_CREATE payload and 1193 verifies that the NFSv4 user id being asserted matches the 1194 destination server's mapping of the user principal. If it does, 1195 the privilege is established on the destination server as: 1196 <"copy_to_auth", user id, source list, nounce, nounce MIC, context 1197 handle, handle version>. The field "handle" in a successful reply 1198 is the RPCSEC_GSSv3 "child" handle that the client will use on 1199 COPY requests to the destination server involving the source 1200 server. granted_assertions[0].assertion.privs.name will be equal 1201 to "copy_to_auth". 1203 As noted in [rpcsec_gssv3] Section 2.3.1 "Create Request", both the 1204 client and the source server should associate the RPCSEC_GSSv3 1205 "child" handle with the parent RPCSEC_GSSv1 (or v2) handle used to 1206 create the RPCSEC_GSSv3 child handle. 1208 4.10.1.1.2. Starting a Secure Inter-Server Copy 1210 When the client sends a COPY_NOTIFY request to the source server, it 1211 uses the privileged "copy_from_auth" RPCSEC_GSSv3 handle. 1212 cna_destination_server in COPY_NOTIFY MUST be the same as 1213 cfap_destination specified in copy_from_auth_priv. Otherwise, 1214 COPY_NOTIFY will fail with NFS4ERR_ACCESS. The source server 1215 verifies that the privilege <"copy_from_auth", user id, destination> 1216 exists, and annotates it with the source filehandle, if the user 1217 principal has read access to the source file, and if administrative 1218 policies give the user principal and the NFS client read access to 1219 the source file (i.e., if the ACCESS operation would grant read 1220 access). Otherwise, COPY_NOTIFY will fail with NFS4ERR_ACCESS. 1222 When the client sends a COPY request to the destination server, it 1223 uses the privileged "copy_to_auth" RPCSEC_GSSv3 handle. 1224 ca_source_server list in COPY MUST be the same as ctap_source list 1225 specified in copy_to_auth_priv. Otherwise, COPY will fail with 1226 NFS4ERR_ACCESS. The destination server verifies that the privilege 1227 <"copy_to_auth", user id, source list, nounce, nounce MIC, context 1228 handle, handle version> exists, and annotates it with the source and 1229 destination filehandles. If the COPY returns a wr_callback_id, then 1230 this is an asynchronous copy and the wr_callback_id must also must be 1231 annotated to the copy_to_auth privilege. If the client has failed to 1232 establish the "copy_to_auth" privilege it will reject the request 1233 with NFS4ERR_PARTNER_NO_AUTH. 1235 If either the COPY_NOTIFY, or the COPY operations fail, the 1236 associated "copy_from_auth" and "copy_to_auth" RPCSEC_GSSv3 handles 1237 MUST be destroyed. 1239 4.10.1.1.3. Securing ONC RPC Server-to-Server Copy Protocols 1241 After a destination server has a "copy_to_auth" privilege established 1242 on it, and it receives a COPY request, if it knows it will use an ONC 1243 RPC protocol to copy data, it will establish a "copy_confirm_auth" 1244 privilege on the source server prior to responding to the COPY 1245 operation as follows: 1247 o Before establishing an RPCSEC_GSSv3 context, a parent context 1248 needs to exist between nfs@ as the initiator 1249 principal, and nfs@ as the target principal. If NFS is to 1250 be used as the copy protocol, this means that the destination 1251 server must mount the source server using RPCSEC_GSS. 1253 o An instance of copy_confirm_auth_priv is filled in with 1254 information from the established "copy_to_auth" privilege. The 1255 value of the field ccap_shared_secret_mic is a GSS_GetMIC() of the 1256 ctap_shared_secret in the copy_to_auth privilege using the parent 1257 handle context. The field ccap_username is the mapping of the 1258 user principal to an NFSv4 user name ("user"@"domain" form), and 1259 MUST be the same as the ctap_username in the copy_to_auth 1260 privilege. The copy_confirm_auth_priv instance is placed in 1261 rpc_gss3_create_args assertions[0].assertion.privs.privilege. The 1262 string "copy_confirm_auth" is placed in 1263 assertions[0].assertion.privs.name. The field 1264 assertions[0].critical is set to TRUE. 1266 o The copy_confirm_auth RPCSEC_GSS3_CREATE call also includes a 1267 compound authentication component. The rpc_gss3_gss_binding 1268 fields are filled in with information from the established 1269 "copy_to_auth" privilege (see Section 4.10.1.1.1). The 1270 ctap_handle_vers, ctap_handle, ctap_nounce, and ctap_nounce_mic 1271 are assigned to the vers, handle, nounce, and mic fields of an 1272 rpc_gss3_gss_binding instance respectively. 1274 o The RPCSEC_GSS3_CREATE copy_from_auth message is sent to the 1275 source server with a QOP of rpc_gss_svc_privacy. The source 1276 server unwraps the rpc_gss_svc_privacy RPCSEC_GSS3_CREATE payload 1277 and verifies the cap_shared_secret_mic by calling GSS_VerifyMIC() 1278 using the parent context on the cfap_shared_secret from the 1279 established "copy_from_auth" privilege, and verifies the that the 1280 ccap_username equals the cfap_username. The source server then 1281 locates the ctap_handle in it's GSS context cache and verifies 1282 that the handle belongs to the user principal that maps to the 1283 ccap_username and that the cached handle version equals 1284 ctap_handle_vers. The ctap_nounce_mic is verified by calling 1285 GSS_VerifyMIC() on the ctap_nounce using the cached handle 1286 context. If all verification succeeds, the "copy_confirm_auth" 1287 privilege is established on the source server as < 1288 "copy_confirm_auth", shared_secret_mic, user id, nounce, nounce 1289 MIC, context handle, context handle version>, and the resultant 1290 child handle is noted to be acting on behalf of the user 1291 principal. If the source server fails to verify either the 1292 privilege or the compound_binding, the COPY operation will be 1293 rejected with NFS4ERR_PARTNER_NO_AUTH. 1295 o All subsequent ONC RPC requests sent from the destination to copy 1296 data from the source to the destination will use the RPCSEC_GSSv3 1297 handle returned by the source's RPCSEC_GSS3_CREATE response. Note 1298 that as per the Compound Authentication section of [rpcsec_gssv3] 1299 the resultant RPCSEC_GSSv3 context handle is bound to the user 1300 principal RPCSEC_GSS context and so it MUST be treated by servers 1301 as authenticating the user principal. 1303 Note that the use of the "copy_confirm_auth" privilege accomplishes 1304 the following: 1306 o If a protocol like NFS is being used, with export policies, export 1307 policies can be overridden in case the destination server as-an- 1308 NFS-client is not authorized 1310 o Manual configuration to allow a copy relationship between the 1311 source and destination is not needed. 1313 4.10.1.1.4. Maintaining a Secure Inter-Server Copy 1315 The secure inter-server copy depends upon both the source server and 1316 the destination server keeping the copy_from_auth and copy_to_auth 1317 RPCSEC_GSS3 context handles valid during the copy. The client SHOULD 1318 use the copy_from_auth RPCSEC_GSS3 context handle for the NFSv4 lease 1319 renewing operation to the source server, and the copy_to_auth 1320 RPCSEC_GSS3 context handle for the NFSv4 lease renewing operation to 1321 the destination server during the copy to periodically determine the 1322 continued validity of the respective GSS3 handles. A periodic RPC 1323 NULL call can also be used for this purpose. 1325 If the client determines that either handle becomes invalid during a 1326 copy, then the copy MUST be aborted by the client sending an 1327 OFFLOAD_CANCEL to both the source and destination servers and 1328 destroying the respective copy related context handles as described 1329 in Section 4.10.1.1.5. 1331 4.10.1.1.5. Finishing or Stopping a Secure Inter-Server Copy 1333 Under normal operation, the client MUST destroy the copy_from_auth 1334 and the copy_to_auth RPCSEC_GSSv3 handle once the COPY operation 1335 returns for a synchronous inter-server copy or a CB_OFFLOAD reports 1336 the result of an asynchronous copy. 1338 The copy_confirm_auth privilege and compound authentication 1339 RPCSEC_GSSv3 handle is constructed from information held by the 1340 copy_to_auth privilege, and MUST be destroyed by the destination 1341 server (via an RPCSEC_GSS3_DESTROY call) when the copy_to_auth 1342 RPCSEC_GSSv3 handle is destroyed. 1344 The copy_confirm_auth RPCSEC_GSS3 handle is associated with a 1345 copy_from_auth RPCSEC_GSS3 handle on the source server via the shared 1346 secret and MUST be locally destroyed (there is no RPCSEC_GSS3_DESTROY 1347 as the source server is not the initiator) when the copy_from_auth 1348 RPCSEC_GSSv3 handle is destroyed. 1350 If the client sends an OFFLOAD_CANCEL to the source server to rescind 1351 the destination server's synchronous copy privilege, it uses the 1352 privileged "copy_from_auth" RPCSEC_GSSv3 handle and the 1353 cra_destination_server in OFFLOAD_CANCEL MUST be the same as the name 1354 of the destination server specified in copy_from_auth_priv. The 1355 source server will then delete the <"copy_from_auth", user id, 1356 destination> privilege and fail any subsequent copy requests sent 1357 under the auspices of this privilege from the destination server. 1358 The client MUST destroy both the "copy_from_auth" and the 1359 "copy_to_auth" RPCSEC_GSSv3 handles. 1361 If the client sends an OFFLOAD_STATUS to the destination server to 1362 check on the status of an asynchronous copy, it uses the privileged 1363 "copy_to_auth" RPCSEC_GSSv3 handle and the osa_stateid in 1364 OFFLOAD_STATUS MUST be the same as the wr_callback_id specified in 1365 the "copy_to_auth" privilege stored on the destination server. 1367 If the client sends an OFFLOAD_CANCEL to the destination server to 1368 cancel an asynchronous copy, it uses the privileged "copy_to_auth" 1369 RPCSEC_GSSv3 handle and the oaa_stateid in OFFLOAD_CANCEL MUST be the 1370 same as the wr_callback_id specified in the "copy_to_auth" privilege 1371 stored on the destination server. The destination server will then 1372 delete the <"copy_to_auth", user id, source list, nounce, nounce MIC, 1373 context handle, handle version> privilege and the associated 1374 "copy_confirm_auth" RPCSEC_GSSv3 handle. The client MUST destroy 1375 both the copy_to_auth and copy_from_auth RPCSEC_GSSv3 handles. 1377 4.10.1.2. Inter-Server Copy via ONC RPC without RPCSEC_GSS 1379 ONC RPC security flavors other than RPCSEC_GSS MAY be used with the 1380 server-side copy offload operations described in this chapter. In 1381 particular, host-based ONC RPC security flavors such as AUTH_NONE and 1382 AUTH_SYS MAY be used. If a host-based security flavor is used, a 1383 minimal level of protection for the server-to-server copy protocol is 1384 possible. 1386 In the absence of a strong security mechanism designed for the 1387 purpose, the challenge is how the source server and destination 1388 server identify themselves to each other, especially in the presence 1389 of multi-homed source and destination servers. In a multi-homed 1390 environment, the destination server might not contact the source 1391 server from the same network address specified by the client in the 1392 COPY_NOTIFY. This can be overcome using the procedure described 1393 below. 1395 When the client sends the source server the COPY_NOTIFY operation, 1396 the source server may reply to the client with a list of target 1397 addresses, names, and/or URLs and assign them to the unique 1398 quadruple: . If the destination uses one of these target netlocs to contact 1400 the source server, the source server will be able to uniquely 1401 identify the destination server, even if the destination server does 1402 not connect from the address specified by the client in COPY_NOTIFY. 1403 The level of assurance in this identification depends on the 1404 unpredictability, strength and secrecy of the random number. 1406 For example, suppose the network topology is as shown in Figure 3. 1407 If the source filehandle is 0x12345, the source server may respond to 1408 a COPY_NOTIFY for destination 203.0.113.56 with the URLs: 1410 nfs://203.0.113.18//_COPY/FvhH1OKbu8VrxvV1erdjvR7N/203.0.113.56/ 1411 _FH/0x12345 1413 nfs://192.0.2.18//_COPY/FvhH1OKbu8VrxvV1erdjvR7N/203.0.113.56/_FH/ 1414 0x12345 1416 The name component after _COPY is 24 characters of base 64, more than 1417 enough to encode a 128 bit random number. 1419 The client will then send these URLs to the destination server in the 1420 COPY operation. Suppose that the 192.0.2.0/24 network is a high 1421 speed network and the destination server decides to transfer the file 1422 over this network. If the destination contacts the source server 1423 from 192.0.2.56 over this network using NFSv4.1, it does the 1424 following: 1426 COMPOUND { PUTROOTFH, LOOKUP "_COPY" ; LOOKUP 1427 "FvhH1OKbu8VrxvV1erdjvR7N" ; LOOKUP "203.0.113.56"; LOOKUP "_FH" ; 1428 OPEN "0x12345" ; GETFH } 1430 Provided that the random number is unpredictable and has been kept 1431 secret by the parties involved, the source server will therefore know 1432 that these NFSv4.x operations are being issued by the destination 1433 server identified in the COPY_NOTIFY. This random number technique 1434 only provides initial authentication of the destination server, and 1435 cannot defend against man-in-the-middle attacks after authentication 1436 or an eavesdropper that observes the random number on the wire. 1437 Other secure communication techniques (e.g., IPsec) are necessary to 1438 block these attacks. 1440 Servers SHOULD reject COPY_NOTIFY requests that do not use RPCSEC_GSS 1441 with privacy, thus ensuring the URL in the COPY_NOTIFY reply is 1442 encrypted. For the same reason, clients SHOULD send COPY requests to 1443 the destination using RPCSEC_GSS with privacy. 1445 4.10.1.3. Inter-Server Copy without ONC RPC 1447 The same techniques as Section 4.10.1.2, using unique URLs for each 1448 destination server, can be used for other protocols (e.g., HTTP 1449 [RFC2616] and FTP [RFC959]) as well. 1451 5. Support for Application IO Hints 1453 Applications can issue client I/O hints via posix_fadvise() 1454 [posix_fadvise] to the NFS client. While this can help the NFS 1455 client optimize I/O and caching for a file, it does not allow the NFS 1456 server and its exported file system to do likewise. We add an 1457 IO_ADVISE procedure (Section 16.5) to communicate the client file 1458 access patterns to the NFS server. The NFS server upon receiving a 1459 IO_ADVISE operation MAY choose to alter its I/O and caching behavior, 1460 but is under no obligation to do so. 1462 Application specific NFS clients such as those used by hypervisors 1463 and databases can also leverage application hints to communicate 1464 their specialized requirements. 1466 6. Sparse Files 1468 6.1. Introduction 1470 A sparse file is a common way of representing a large file without 1471 having to utilize all of the disk space for it. Consequently, a 1472 sparse file uses less physical space than its size indicates. This 1473 means the file contains 'holes', byte ranges within the file that 1474 contain no data. Most modern file systems support sparse files, 1475 including most UNIX file systems and NTFS, but notably not Apple's 1476 HFS+. Common examples of sparse files include Virtual Machine (VM) 1477 OS/disk images, database files, log files, and even checkpoint 1478 recovery files most commonly used by the HPC community. 1480 In addition many modern file systems support the concept of 1481 'unwritten' or 'uninitialized' blocks, which have uninitialized space 1482 allocated to them on disk, but will return zeros until data is 1483 written to them. Such functionality is already present in the data 1484 model of the pNFS Block/Volume Layout (see [RFC5663]). Uninitialized 1485 blocks can thought as holes inside a space reservation window. 1487 If an application reads a hole in a sparse file, the file system must 1488 return all zeros to the application. For local data access there is 1489 little penalty, but with NFS these zeroes must be transferred back to 1490 the client. If an application uses the NFS client to read data into 1491 memory, this wastes time and bandwidth as the application waits for 1492 the zeroes to be transferred. 1494 A sparse file is typically created by initializing the file to be all 1495 zeros - nothing is written to the data in the file, instead the hole 1496 is recorded in the metadata for the file. So a 8G disk image might 1497 be represented initially by a couple hundred bits in the inode and 1498 nothing on the disk. If the VM then writes 100M to a file in the 1499 middle of the image, there would now be two holes represented in the 1500 metadata and 100M in the data. 1502 No new operation is needed to allow the creation of a sparsely 1503 populated file, when a file is created and a write occurs past the 1504 current size of the file, the non-allocated region will either be a 1505 hole or filled with zeros. The choice of behavior is dictated by the 1506 underlying file system and is transparent to the application. What 1507 is needed are the abilities to read sparse files and to punch holes 1508 to reinitialize the contents of a file. 1510 Two new operations DEALLOCATE (Section 16.4) and READ_PLUS 1511 (Section 16.10) are introduced. DEALLOCATE allows for the hole 1512 punching. I.e., an application might want to reset the allocation 1513 and reservation status of a range of the file. READ_PLUS supports 1514 all the features of READ but includes an extension to support sparse 1515 files. READ_PLUS is guaranteed to perform no worse than READ, and 1516 can dramatically improve performance with sparse files. READ_PLUS 1517 does not depend on pNFS protocol features, but can be used by pNFS to 1518 support sparse files. 1520 6.2. Terminology 1522 Regular file: An object of file type NF4REG or NF4NAMEDATTR. 1524 Sparse file: A Regular file that contains one or more holes. 1526 Hole: A byte range within a Sparse file that contains regions of all 1527 zeroes. A hole might or might not have space allocated or 1528 reserved to it. 1530 6.3. New Operations 1532 6.3.1. READ_PLUS 1534 READ_PLUS is a new variant of the NFSv4.1 READ operation [RFC5661]. 1535 Besides being able to support all of the data semantics of the READ 1536 operation, it can also be used by the client and server to 1537 efficiently transfer holes. Note that as the client has no a priori 1538 knowledge of whether a hole is present or not, if the client supports 1539 READ_PLUS and so does the server, then it should always use the 1540 READ_PLUS operation in preference to the READ operation. 1542 READ_PLUS extends the response with a new arm representing holes to 1543 avoid returning data for portions of the file which are initialized 1544 to zero and may or may not contain a backing store. Returning data 1545 blocks of uninitialized data wastes computational and network 1546 resources, thus reducing performance. 1548 If the client sends a READ operation, it is explicitly stating that 1549 it is not supporting sparse files. So if a READ occurs on a sparse 1550 file, then the server must expand such data to be raw bytes. If a 1551 READ occurs in the middle of a hole, the server can only send back 1552 bytes starting from that offset. In contrast, if a READ_PLUS occurs 1553 in the middle of a hole, the server can send back a range which 1554 starts before the offset and extends past the range. 1556 6.3.2. DEALLOCATE 1558 DEALLOCATE can be used to hole punch, which allows the client to 1559 avoid the transfer of a repetitive pattern of zeros across the 1560 network. 1562 7. Space Reservation 1563 7.1. Introduction 1565 Applications want to be able to reserve space for a file, report the 1566 amount of actual disk space a file occupies, and free-up the backing 1567 space of a file when it is not required. 1569 One example is the posix_fallocate ([posix_fallocate]) which allows 1570 applications to ask for space reservations from the operating system, 1571 usually to provide a better file layout and reduce overhead for 1572 random or slow growing file appending workloads. 1574 Another example is space reservation for virtual disks in a 1575 hypervisor. In virtualized environments, virtual disk files are 1576 often stored on NFS mounted volumes. When a hypervisor creates a 1577 virtual disk file, it often tries to preallocate the space for the 1578 file so that there are no future allocation related errors during the 1579 operation of the virtual machine. Such errors prevent a virtual 1580 machine from continuing execution and result in downtime. 1582 Currently, in order to achieve such a guarantee, applications zero 1583 the entire file. The initial zeroing allocates the backing blocks 1584 and all subsequent writes are overwrites of already allocated blocks. 1585 This approach is not only inefficient in terms of the amount of I/O 1586 done, it is also not guaranteed to work on file systems that are log 1587 structured or deduplicated. An efficient way of guaranteeing space 1588 reservation would be beneficial to such applications. 1590 The new ALLOCATE operation (see Section 16.1) allows a client to 1591 request a guarantee that space will be available. The ALLOCATE 1592 operation guarantees that any future writes to the region it was 1593 successfully called for will not fail with NFS4ERR_NOSPC. 1595 Another useful feature is the ability to report the number of blocks 1596 that would be freed when a file is deleted. Currently, NFS reports 1597 two size attributes: 1599 size The logical file size of the file. 1601 space_used The size in bytes that the file occupies on disk 1603 While these attributes are sufficient for space accounting in 1604 traditional file systems, they prove to be inadequate in modern file 1605 systems that support block sharing. In such file systems, multiple 1606 inodes can point to a single block with a block reference count to 1607 guard against premature freeing. Having a way to tell the number of 1608 blocks that would be freed if the file was deleted would be useful to 1609 applications that wish to migrate files when a volume is low on 1610 space. 1612 Since virtual disks represent a hard drive in a virtual machine, a 1613 virtual disk can be viewed as a file system within a file. Since not 1614 all blocks within a file system are in use, there is an opportunity 1615 to reclaim blocks that are no longer in use. A call to deallocate 1616 blocks could result in better space efficiency. Lesser space MAY be 1617 consumed for backups after block deallocation. 1619 The following operations and attributes can be used to resolve these 1620 issues: 1622 space_freed This attribute specifies the space freed when a file is 1623 deleted, taking block sharing into consideration. 1625 DEALLOCATE This operation delallocates the blocks backing a region 1626 of the file. 1628 If space_used of a file is interpreted to mean the size in bytes of 1629 all disk blocks pointed to by the inode of the file, then shared 1630 blocks get double counted, over-reporting the space utilization. 1631 This also has the adverse effect that the deletion of a file with 1632 shared blocks frees up less than space_used bytes. 1634 On the other hand, if space_used is interpreted to mean the size in 1635 bytes of those disk blocks unique to the inode of the file, then 1636 shared blocks are not counted in any file, resulting in under- 1637 reporting of the space utilization. 1639 For example, two files A and B have 10 blocks each. Let 6 of these 1640 blocks be shared between them. Thus, the combined space utilized by 1641 the two files is 14 * BLOCK_SIZE bytes. In the former case, the 1642 combined space utilization of the two files would be reported as 20 * 1643 BLOCK_SIZE. However, deleting either would only result in 4 * 1644 BLOCK_SIZE being freed. Conversely, the latter interpretation would 1645 report that the space utilization is only 8 * BLOCK_SIZE. 1647 Adding another size attribute, space_freed (see Section 13.2.3), is 1648 helpful in solving this problem. space_freed is the number of blocks 1649 that are allocated to the given file that would be freed on its 1650 deletion. In the example, both A and B would report space_freed as 4 1651 * BLOCK_SIZE and space_used as 10 * BLOCK_SIZE. If A is deleted, B 1652 will report space_freed as 10 * BLOCK_SIZE as the deletion of B would 1653 result in the deallocation of all 10 blocks. 1655 The addition of this problem does not solve the problem of space 1656 being over-reported. However, over-reporting is better than under- 1657 reporting. 1659 8. Application Data Block Support 1661 At the OS level, files are contained on disk blocks. Applications 1662 are also free to impose structure on the data contained in a file and 1663 we can define an Application Data Block (ADB) to be such a structure. 1664 From the application's viewpoint, it only wants to handle ADBs and 1665 not raw bytes (see [Strohm11]). An ADB is typically comprised of two 1666 sections: header and data. The header describes the characteristics 1667 of the block and can provide a means to detect corruption in the data 1668 payload. The data section is typically initialized to all zeros. 1670 The format of the header is application specific, but there are two 1671 main components typically encountered: 1673 1. An Application Data Block Number (ADBN) which allows the 1674 application to determine which data block is being referenced. 1675 This is useful when the client is not storing the blocks in 1676 contiguous memory, i.e., a logical block number. 1678 2. Fields to describe the state of the ADB and a means to detect 1679 block corruption. For both pieces of data, a useful property is 1680 that allowed values be unique in that if passed across the 1681 network, corruption due to translation between big and little 1682 endian architectures are detectable. For example, 0xF0DEDEF0 has 1683 the same bit pattern in both architectures. 1685 Applications already impose structures on files [Strohm11] and detect 1686 corruption in data blocks [Ashdown08]. What they are not able to do 1687 is efficiently transfer and store ADBs. To initialize a file with 1688 ADBs, the client must send each full ADB to the server and that must 1689 be stored on the server. 1691 In this section, we define a framework for transferring the ADB from 1692 client to server and present one approach to detecting corruption in 1693 a given ADB implementation. 1695 8.1. Generic Framework 1697 We want the representation of the ADB to be flexible enough to 1698 support many different applications. The most basic approach is no 1699 imposition of a block at all, which means we are working with the raw 1700 bytes. Such an approach would be useful for storing holes, punching 1701 holes, etc. In more complex deployments, a server might be 1702 supporting multiple applications, each with their own definition of 1703 the ADB. One might store the ADBN at the start of the block and then 1704 have a guard pattern to detect corruption [McDougall07]. The next 1705 might store the ADBN at an offset of 100 bytes within the block and 1706 have no guard pattern at all, i.e., existing applications might 1707 already have well defined formats for their data blocks. 1709 The guard pattern can be used to represent the state of the block, to 1710 protect against corruption, or both. Again, it needs to be able to 1711 be placed anywhere within the ADB. 1713 We need to be able to represent the starting offset of the block and 1714 the size of the block. Note that nothing prevents the application 1715 from defining different sized blocks in a file. 1717 8.1.1. Data Block Representation 1719 struct app_data_block4 { 1720 offset4 adb_offset; 1721 length4 adb_block_size; 1722 length4 adb_block_count; 1723 length4 adb_reloff_blocknum; 1724 count4 adb_block_num; 1725 length4 adb_reloff_pattern; 1726 opaque adb_pattern<>; 1727 }; 1729 The app_data_block4 structure captures the abstraction presented for 1730 the ADB. The additional fields present are to allow the transmission 1731 of adb_block_count ADBs at one time. We also use adb_block_num to 1732 convey the ADBN of the first block in the sequence. Each ADB will 1733 contain the same adb_pattern string. 1735 As both adb_block_num and adb_pattern are optional, if either 1736 adb_reloff_pattern or adb_reloff_blocknum is set to NFS4_UINT64_MAX, 1737 then the corresponding field is not set in any of the ADB. 1739 8.2. An Example of Detecting Corruption 1741 In this section, we define an ADB format in which corruption can be 1742 detected. Note that this is just one possible format and means to 1743 detect corruption. 1745 Consider a very basic implementation of an operating system's disk 1746 blocks. A block is either data or it is an indirect block which 1747 allows for files to be larger than one block. It is desired to be 1748 able to initialize a block. Lastly, to quickly unlink a file, a 1749 block can be marked invalid. The contents remain intact - which 1750 would enable this OS application to undelete a file. 1752 The application defines 4k sized data blocks, with an 8 byte block 1753 counter occurring at offset 0 in the block, and with the guard 1754 pattern occurring at offset 8 inside the block. Furthermore, the 1755 guard pattern can take one of four states: 1757 0xfeedface - This is the FREE state and indicates that the ADB 1758 format has been applied. 1760 0xcafedead - This is the DATA state and indicates that real data 1761 has been written to this block. 1763 0xe4e5c001 - This is the INDIRECT state and indicates that the 1764 block contains block counter numbers that are chained off of this 1765 block. 1767 0xba1ed4a3 - This is the INVALID state and indicates that the block 1768 contains data whose contents are garbage. 1770 Finally, it also defines an 8 byte checksum [Baira08] starting at 1771 byte 16 which applies to the remaining contents of the block. If the 1772 state is FREE, then that checksum is trivially zero. As such, the 1773 application has no need to transfer the checksum implicitly inside 1774 the ADB - it need not make the transfer layer aware of the fact that 1775 there is a checksum (see [Ashdown08] for an example of checksums used 1776 to detect corruption in application data blocks). 1778 Corruption in each ADB can thus be detected: 1780 o If the guard pattern is anything other than one of the allowed 1781 values, including all zeros. 1783 o If the guard pattern is FREE and any other byte in the remainder 1784 of the ADB is anything other than zero. 1786 o If the guard pattern is anything other than FREE, then if the 1787 stored checksum does not match the computed checksum. 1789 o If the guard pattern is INDIRECT and one of the stored indirect 1790 block numbers has a value greater than the number of ADBs in the 1791 file. 1793 o If the guard pattern is INDIRECT and one of the stored indirect 1794 block numbers is a duplicate of another stored indirect block 1795 number. 1797 As can be seen, the application can detect errors based on the 1798 combination of the guard pattern state and the checksum. But also, 1799 the application can detect corruption based on the state and the 1800 contents of the ADB. This last point is important in validating the 1801 minimum amount of data we incorporated into our generic framework. 1803 I.e., the guard pattern is sufficient in allowing applications to 1804 design their own corruption detection. 1806 Finally, it is important to note that none of these corruption checks 1807 occur in the transport layer. The server and client components are 1808 totally unaware of the file format and might report everything as 1809 being transferred correctly even in the case the application detects 1810 corruption. 1812 8.3. Example of READ_PLUS 1814 The hypothetical application presented in Section 8.2 can be used to 1815 illustrate how READ_PLUS would return an array of results. A file is 1816 created and initialized with 100 4k ADBs in the FREE state with the 1817 WRITE_SAME operation (see Section 16.12): 1819 WRITE_SAME {0, 4k, 100, 0, 0, 8, 0xfeedface} 1821 Further, assume the application writes a single ADB at 16k, changing 1822 the guard pattern to 0xcafedead, we would then have in memory: 1824 0k -> (4k - 1) : 00 00 00 00 fe ed fa ce 00 00 ... 00 00 1825 4k -> (8k - 1) : 00 00 00 01 fe ed fa ce 00 00 ... 00 00 1826 8k -> (12k - 1) : 00 00 00 02 fe ed fa ce 00 00 ... 00 00 1827 12k -> (16k - 1) : 00 00 00 03 fe ed fa ce 00 00 ... 00 00 1828 16k -> (20k - 1) : 00 00 00 04 ca fe de ad 00 00 ... 00 00 1829 20k -> (24k - 1) : 00 00 00 05 fe ed fa ce 00 00 ... 00 00 1830 24k -> (28k - 1) : 00 00 00 06 fe ed fa ce 00 00 ... 00 00 1831 ... 1832 396k -> (400k - 1) : 00 00 00 63 fe ed fa ce 00 00 ... 00 00 1834 And when the client did a READ_PLUS of 64k at the start of the file, 1835 it could get back a result of data: 1837 0k -> (4k - 1) : 00 00 00 00 fe ed fa ce 00 00 ... 00 00 1838 4k -> (8k - 1) : 00 00 00 01 fe ed fa ce 00 00 ... 00 00 1839 8k -> (12k - 1) : 00 00 00 02 fe ed fa ce 00 00 ... 00 00 1840 12k -> (16k - 1) : 00 00 00 03 fe ed fa ce 00 00 ... 00 00 1841 16k -> (20k - 1) : 00 00 00 04 ca fe de ad 00 00 ... 00 00 1842 20k -> (24k - 1) : 00 00 00 05 fe ed fa ce 00 00 ... 00 00 1843 24k -> (24k - 1) : 00 00 00 06 fe ed fa ce 00 00 ... 00 00 1844 ... 1845 62k -> (64k - 1) : 00 00 00 15 fe ed fa ce 00 00 ... 00 00 1847 8.4. An Example of Zeroing Space 1849 A simpler use case for WRITE_SAME are applications that want to 1850 efficiently zero out a file, but do not want to modify space 1851 reservations. This can easily be archived by a call to WRITE_SAME 1852 without a ADB block numbers and pattern, e.g.: 1854 WRITE_SAME {0, 1k, 10000, 0, 0, 0, 0} 1856 9. Labeled NFS 1858 9.1. Introduction 1860 Access control models such as Unix permissions or Access Control 1861 Lists are commonly referred to as Discretionary Access Control (DAC) 1862 models. These systems base their access decisions on user identity 1863 and resource ownership. In contrast Mandatory Access Control (MAC) 1864 models base their access control decisions on the label on the 1865 subject (usually a process) and the object it wishes to access 1866 [RFC7204]. These labels may contain user identity information but 1867 usually contain additional information. In DAC systems users are 1868 free to specify the access rules for resources that they own. MAC 1869 models base their security decisions on a system wide policy 1870 established by an administrator or organization which the users do 1871 not have the ability to override. In this section, we add a MAC 1872 model to NFSv4.2. 1874 First we provide a method for transporting and storing security label 1875 data on NFSv4 file objects. Security labels have several semantics 1876 that are met by NFSv4 recommended attributes such as the ability to 1877 set the label value upon object creation. Access control on these 1878 attributes are done through a combination of two mechanisms. As with 1879 other recommended attributes on file objects the usual DAC checks 1880 (ACLs and permission bits) will be performed to ensure that proper 1881 file ownership is enforced. In addition a MAC system MAY be employed 1882 on the client, server, or both to enforce additional policy on what 1883 subjects may modify security label information. 1885 Second, we describe a method for the client to determine if an NFSv4 1886 file object security label has changed. A client which needs to know 1887 if a label on a file or set of files is going to change SHOULD 1888 request a delegation on each labeled file. In order to change such a 1889 security label, the server will have to recall delegations on any 1890 file affected by the label change, so informing clients of the label 1891 change. 1893 An additional useful feature would be modification to the RPC layer 1894 used by NFSv4 to allow RPC calls to carry security labels and enable 1895 full mode enforcement as described in Section 9.6.1. Such 1896 modifications are outside the scope of this document (see 1897 [rpcsec_gssv3]). 1899 9.2. Definitions 1901 Label Format Specifier (LFS): is an identifier used by the client to 1902 establish the syntactic format of the security label and the 1903 semantic meaning of its components. These specifiers exist in a 1904 registry associated with documents describing the format and 1905 semantics of the label. 1907 Label Format Registry: is the IANA registry (see [Quigley14]) 1908 containing all registered LFSes along with references to the 1909 documents that describe the syntactic format and semantics of the 1910 security label. 1912 Policy Identifier (PI): is an optional part of the definition of a 1913 Label Format Specifier which allows for clients and server to 1914 identify specific security policies. 1916 Object: is a passive resource within the system that we wish to be 1917 protected. Objects can be entities such as files, directories, 1918 pipes, sockets, and many other system resources relevant to the 1919 protection of the system state. 1921 Subject: is an active entity usually a process which is requesting 1922 access to an object. 1924 MAC-Aware: is a server which can transmit and store object labels. 1926 MAC-Functional: is a client or server which is Labeled NFS enabled. 1927 Such a system can interpret labels and apply policies based on the 1928 security system. 1930 Multi-Level Security (MLS): is a traditional model where objects are 1931 given a sensitivity level (Unclassified, Secret, Top Secret, etc) 1932 and a category set (see [BL73], [RFC1108], and [RFC2401]). 1934 9.3. MAC Security Attribute 1936 MAC models base access decisions on security attributes bound to 1937 subjects and objects. This information can range from a user 1938 identity for an identity based MAC model, sensitivity levels for 1939 Multi-level security, or a type for Type Enforcement. These models 1940 base their decisions on different criteria but the semantics of the 1941 security attribute remain the same. The semantics required by the 1942 security attributes are listed below: 1944 o MUST provide flexibility with respect to the MAC model. 1946 o MUST provide the ability to atomically set security information 1947 upon object creation. 1949 o MUST provide the ability to enforce access control decisions both 1950 on the client and the server. 1952 o MUST NOT expose an object to either the client or server name 1953 space before its security information has been bound to it. 1955 NFSv4 implements the security attribute as a recommended attribute. 1956 These attributes have a fixed format and semantics, which conflicts 1957 with the flexible nature of the security attribute. To resolve this 1958 the security attribute consists of two components. The first 1959 component is a LFS as defined in [Quigley14] to allow for 1960 interoperability between MAC mechanisms. The second component is an 1961 opaque field which is the actual security attribute data. To allow 1962 for various MAC models, NFSv4 should be used solely as a transport 1963 mechanism for the security attribute. It is the responsibility of 1964 the endpoints to consume the security attribute and make access 1965 decisions based on their respective models. In addition, creation of 1966 objects through OPEN and CREATE allows for the security attribute to 1967 be specified upon creation. By providing an atomic create and set 1968 operation for the security attribute it is possible to enforce the 1969 second and fourth requirements. The recommended attribute 1970 FATTR4_SEC_LABEL (see Section 13.2.2) will be used to satisfy this 1971 requirement. 1973 9.3.1. Delegations 1975 In the event that a security attribute is changed on the server while 1976 a client holds a delegation on the file, both the server and the 1977 client MUST follow the NFSv4.1 protocol (see Chapter 10 of [RFC5661]) 1978 with respect to attribute changes. It SHOULD flush all changes back 1979 to the server and relinquish the delegation. 1981 9.3.2. Permission Checking 1983 It is not feasible to enumerate all possible MAC models and even 1984 levels of protection within a subset of these models. This means 1985 that the NFSv4 client and servers cannot be expected to directly make 1986 access control decisions based on the security attribute. Instead 1987 NFSv4 should defer permission checking on this attribute to the host 1988 system. These checks are performed in addition to existing DAC and 1989 ACL checks outlined in the NFSv4 protocol. Section 9.6 gives a 1990 specific example of how the security attribute is handled under a 1991 particular MAC model. 1993 9.3.3. Object Creation 1995 When creating files in NFSv4 the OPEN and CREATE operations are used. 1996 One of the parameters to these operations is an fattr4 structure 1997 containing the attributes the file is to be created with. This 1998 allows NFSv4 to atomically set the security attribute of files upon 1999 creation. When a client is MAC-Functional it must always provide the 2000 initial security attribute upon file creation. In the event that the 2001 server is MAC-Functional as well, it should determine by policy 2002 whether it will accept the attribute from the client or instead make 2003 the determination itself. If the client is not MAC-Functional, then 2004 the MAC-Functional server must decide on a default label. A more in 2005 depth explanation can be found in Section 9.6. 2007 9.3.4. Existing Objects 2009 Note that under the MAC model, all objects must have labels. 2010 Therefore, if an existing server is upgraded to include Labeled NFS 2011 support, then it is the responsibility of the security system to 2012 define the behavior for existing objects. 2014 9.3.5. Label Changes 2016 Consider a guest mode system (Section 9.6.2) in which the clients 2017 enforce MAC checks and the server has only a DAC security system 2018 which stores the labels along with the file data. In this type of 2019 system, a user with the appropriate DAC credentials on a client with 2020 poorly configured or disabled MAC labeling enforcement is allowed 2021 access to the file label (and data) on the server and can change the 2022 label. 2024 Clients which need to know if a label on a file or set of files has 2025 changed SHOULD request a delegation on each labeled file so that a 2026 label change by another client will be known via the process 2027 described in Section 9.3.1 which must be followed: the delegation 2028 will be recalled, which effectively notifies the client of the 2029 change. 2031 Note that the MAC security policies on a client can be such that the 2032 client does not have access to the file unless it has a delegation. 2034 9.4. pNFS Considerations 2036 The new FATTR4_SEC_LABEL attribute is metadata information and as 2037 such the DS is not aware of the value contained on the MDS. 2038 Fortunately, the NFSv4.1 protocol [RFC5661] already has provisions 2039 for doing access level checks from the DS to the MDS. In order for 2040 the DS to validate the subject label presented by the client, it 2041 SHOULD utilize this mechanism. 2043 9.5. Discovery of Server Labeled NFS Support 2045 The server can easily determine that a client supports Labeled NFS 2046 when it queries for the FATTR4_SEC_LABEL label for an object. The 2047 client might need to discover which LFS the server supports. 2049 The following compound MUST NOT be denied by any MAC label check: 2051 PUTROOTFH, GETATTR {FATTR4_SEC_LABEL} 2053 Note that the server might have imposed a security flavor on the root 2054 that precludes such access. I.e., if the server requires kerberized 2055 access and the client presents a compound with AUTH_SYS, then the 2056 server is allowed to return NFS4ERR_WRONGSEC in this case. But if 2057 the client presents a correct security flavor, then the server MUST 2058 return the FATTR4_SEC_LABEL attribute with the supported LFS filled 2059 in. 2061 9.6. MAC Security NFS Modes of Operation 2063 A system using Labeled NFS may operate in two modes. The first mode 2064 provides the most protection and is called "full mode". In this mode 2065 both the client and server implement a MAC model allowing each end to 2066 make an access control decision. The remaining mode is called the 2067 "guest mode" and in this mode one end of the connection is not 2068 implementing a MAC model and thus offers less protection than full 2069 mode. 2071 9.6.1. Full Mode 2073 Full mode environments consist of MAC-Functional NFSv4 servers and 2074 clients and may be composed of mixed MAC models and policies. The 2075 system requires that both the client and server have an opportunity 2076 to perform an access control check based on all relevant information 2077 within the network. The file object security attribute is provided 2078 using the mechanism described in Section 9.3. 2080 Fully MAC-Functional NFSv4 servers are not possible in the absence of 2081 RPC layer modifications to support subject label transport. However, 2082 servers may make decisions based on the RPC credential information 2083 available and future specifications may provide subject label 2084 transport. 2086 9.6.1.1. Initial Labeling and Translation 2088 The ability to create a file is an action that a MAC model may wish 2089 to mediate. The client is given the responsibility to determine the 2090 initial security attribute to be placed on a file. This allows the 2091 client to make a decision as to the acceptable security attributes to 2092 create a file with before sending the request to the server. Once 2093 the server receives the creation request from the client it may 2094 choose to evaluate if the security attribute is acceptable. 2096 Security attributes on the client and server may vary based on MAC 2097 model and policy. To handle this the security attribute field has an 2098 LFS component. This component is a mechanism for the host to 2099 identify the format and meaning of the opaque portion of the security 2100 attribute. A full mode environment may contain hosts operating in 2101 several different LFSes. In this case a mechanism for translating 2102 the opaque portion of the security attribute is needed. The actual 2103 translation function will vary based on MAC model and policy and is 2104 out of the scope of this document. If a translation is unavailable 2105 for a given LFS then the request MUST be denied. Another recourse is 2106 to allow the host to provide a fallback mapping for unknown security 2107 attributes. 2109 9.6.1.2. Policy Enforcement 2111 In full mode access control decisions are made by both the clients 2112 and servers. When a client makes a request it takes the security 2113 attribute from the requesting process and makes an access control 2114 decision based on that attribute and the security attribute of the 2115 object it is trying to access. If the client denies that access an 2116 RPC call to the server is never made. If however the access is 2117 allowed the client will make a call to the NFS server. 2119 When the server receives the request from the client it uses any 2120 credential information conveyed in the RPC request and the attributes 2121 of the object the client is trying to access to make an access 2122 control decision. If the server's policy allows this access it will 2123 fulfill the client's request, otherwise it will return 2124 NFS4ERR_ACCESS. 2126 Future protocol extensions may also allow the server to factor into 2127 the decision a security label extracted from the RPC request. 2129 Implementations MAY validate security attributes supplied over the 2130 network to ensure that they are within a set of attributes permitted 2131 from a specific peer, and if not, reject them. Note that a system 2132 may permit a different set of attributes to be accepted from each 2133 peer. 2135 9.6.1.3. Limited Server 2137 A Limited Server mode (see Section 4.2 of [RFC7204]) consists of a 2138 server which is label aware, but does not enforce policies. Such a 2139 server will store and retrieve all object labels presented by 2140 clients, utilize the methods described in Section 9.3.5 to allow the 2141 clients to detect changing labels, but may not factor the label into 2142 access decisions. Instead, it will expect the clients to enforce all 2143 such access locally. 2145 9.6.2. Guest Mode 2147 Guest mode implies that either the client or the server does not 2148 handle labels. If the client is not Labeled NFS aware, then it will 2149 not offer subject labels to the server. The server is the only 2150 entity enforcing policy, and may selectively provide standard NFS 2151 services to clients based on their authentication credentials and/or 2152 associated network attributes (e.g., IP address, network interface). 2153 The level of trust and access extended to a client in this mode is 2154 configuration-specific. If the server is not Labeled NFS aware, then 2155 it will not return object labels to the client. Clients in this 2156 environment are may consist of groups implementing different MAC 2157 model policies. The system requires that all clients in the 2158 environment be responsible for access control checks. 2160 9.7. Security Considerations 2162 This entire chapter deals with security issues. 2164 Depending on the level of protection the MAC system offers there may 2165 be a requirement to tightly bind the security attribute to the data. 2167 When only one of the client or server enforces labels, it is 2168 important to realize that the other side is not enforcing MAC 2169 protections. Alternate methods might be in use to handle the lack of 2170 MAC support and care should be taken to identify and mitigate threats 2171 from possible tampering outside of these methods. 2173 An example of this is that a server that modifies READDIR or LOOKUP 2174 results based on the client's subject label might want to always 2175 construct the same subject label for a client which does not present 2176 one. This will prevent a non-Labeled NFS client from mixing entries 2177 in the directory cache. 2179 10. Sharing change attribute implementation details with NFSv4 clients 2181 10.1. Introduction 2183 Although both the NFSv4 [I-D.ietf-nfsv4-rfc3530bis] and NFSv4.1 2184 protocol [RFC5661], define the change attribute as being mandatory to 2185 implement, there is little in the way of guidance. The only mandated 2186 feature is that the value must change whenever the file data or 2187 metadata change. 2189 While this allows for a wide range of implementations, it also leaves 2190 the client with a conundrum: how does it determine which is the most 2191 recent value for the change attribute in a case where several RPC 2192 calls have been issued in parallel? In other words if two COMPOUNDs, 2193 both containing WRITE and GETATTR requests for the same file, have 2194 been issued in parallel, how does the client determine which of the 2195 two change attribute values returned in the replies to the GETATTR 2196 requests correspond to the most recent state of the file? In some 2197 cases, the only recourse may be to send another COMPOUND containing a 2198 third GETATTR that is fully serialized with the first two. 2200 NFSv4.2 avoids this kind of inefficiency by allowing the server to 2201 share details about how the change attribute is expected to evolve, 2202 so that the client may immediately determine which, out of the 2203 several change attribute values returned by the server, is the most 2204 recent. change_attr_type is defined as a new recommended attribute 2205 (see Section 13.2.1), and is per file system. 2207 11. Security Considerations 2209 NFSv4.2 has all of the security concerns present in NFSv4.1 (see 2210 Section 21 of [RFC5661]) and those present in the Server Side Copy 2211 (see Section 4.10) and in Labeled NFS (see Section 9.7). 2213 12. Error Values 2215 NFS error numbers are assigned to failed operations within a Compound 2216 (COMPOUND or CB_COMPOUND) request. A Compound request contains a 2217 number of NFS operations that have their results encoded in sequence 2218 in a Compound reply. The results of successful operations will 2219 consist of an NFS4_OK status followed by the encoded results of the 2220 operation. If an NFS operation fails, an error status will be 2221 entered in the reply and the Compound request will be terminated. 2223 12.1. Error Definitions 2225 Protocol Error Definitions 2227 +-------------------------+--------+------------------+ 2228 | Error | Number | Description | 2229 +-------------------------+--------+------------------+ 2230 | NFS4ERR_BADLABEL | 10093 | Section 12.1.3.1 | 2231 | NFS4ERR_OFFLOAD_DENIED | 10091 | Section 12.1.2.1 | 2232 | NFS4ERR_OFFLOAD_NO_REQS | 10094 | Section 12.1.2.2 | 2233 | NFS4ERR_PARTNER_NO_AUTH | 10089 | Section 12.1.2.3 | 2234 | NFS4ERR_PARTNER_NOTSUPP | 10088 | Section 12.1.2.4 | 2235 | NFS4ERR_UNION_NOTSUPP | 10090 | Section 12.1.1.1 | 2236 | NFS4ERR_WRONG_LFS | 10092 | Section 12.1.3.2 | 2237 +-------------------------+--------+------------------+ 2239 Table 1 2241 12.1.1. General Errors 2243 This section deals with errors that are applicable to a broad set of 2244 different purposes. 2246 12.1.1.1. NFS4ERR_UNION_NOTSUPP (Error Code 10090) 2248 One of the arguments to the operation is a discriminated union and 2249 while the server supports the given operation, it does not support 2250 the selected arm of the discriminated union. 2252 12.1.2. Server to Server Copy Errors 2254 These errors deal with the interaction between server to server 2255 copies. 2257 12.1.2.1. NFS4ERR_OFFLOAD_DENIED (Error Code 10091) 2259 The copy offload operation is supported by both the source and the 2260 destination, but the destination is not allowing it for this file. 2261 If the client sees this error, it should fall back to the normal copy 2262 semantics. 2264 12.1.2.2. NFS4ERR_OFFLOAD_NO_REQS (Error Code 10094) 2266 The copy offload operation is supported by both the source and the 2267 destination, but the destination can not meet the client requirements 2268 for either consecutive byte copy or synchronous copy. If the client 2269 sees this error, it should either relax the requirements (if any) or 2270 fall back to the normal copy semantics. 2272 12.1.2.3. NFS4ERR_PARTNER_NO_AUTH (Error Code 10089) 2274 The source server does not authorize a server-to-server copy offload 2275 operation. This may be due to the client's failure to send the 2276 COPY_NOTIFY operation to the source server, the source server 2277 receiving a server-to-server copy offload request after the copy 2278 lease time expired, or for some other permission problem. 2280 12.1.2.4. NFS4ERR_PARTNER_NOTSUPP (Error Code 10088) 2282 The remote server does not support the server-to-server copy offload 2283 protocol. 2285 12.1.3. Labeled NFS Errors 2287 These errors are used in Labeled NFS. 2289 12.1.3.1. NFS4ERR_BADLABEL (Error Code 10093) 2291 The label specified is invalid in some manner. 2293 12.1.3.2. NFS4ERR_WRONG_LFS (Error Code 10092) 2295 The LFS specified in the subject label is not compatible with the LFS 2296 in the object label. 2298 12.2. New Operations and Their Valid Errors 2300 This section contains a table that gives the valid error returns for 2301 each new NFSv4.2 protocol operation. The error code NFS4_OK 2302 (indicating no error) is not listed but should be understood to be 2303 returnable by all new operations. The error values for all other 2304 operations are defined in Section 15.2 of [RFC5661]. 2306 Valid Error Returns for Each New Protocol Operation 2308 +----------------+--------------------------------------------------+ 2309 | Operation | Errors | 2310 +----------------+--------------------------------------------------+ 2311 | ALLOCATE | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | 2312 | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | 2313 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2314 | | NFS4ERR_DELEG_REVOKED, NFS4ERR_DQUOT, | 2315 | | NFS4ERR_EXPIRED, NFS4ERR_FBIG, | 2316 | | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, | 2317 | | NFS4ERR_IO, NFS4ERR_ISDIR, NFS4ERR_MOVED, | 2318 | | NFS4ERR_NOFILEHANDLE, NFS4ERR_NOSPC, | 2319 | | NFS4ERR_NOTSUPP, NFS4ERR_OLD_STATEID, | 2320 | | NFS4ERR_OPENMODE, NFS4ERR_OP_NOT_IN_SESSION, | 2321 | | NFS4ERR_REP_TOO_BIG, | 2322 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2323 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2324 | | NFS4ERR_ROFS, NFS4ERR_SERVERFAULT, | 2325 | | NFS4ERR_STALE, NFS4ERR_SYMLINK, | 2326 | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | 2327 | COPY | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | 2328 | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | 2329 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2330 | | NFS4ERR_DELEG_REVOKED, NFS4ERR_DQUOT, | 2331 | | NFS4ERR_EXPIRED, NFS4ERR_FBIG, | 2332 | | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, | 2333 | | NFS4ERR_IO, NFS4ERR_ISDIR, NFS4ERR_LOCKED, | 2334 | | NFS4ERR_METADATA_NOTSUPP, NFS4ERR_MOVED, | 2335 | | NFS4ERR_NOFILEHANDLE, NFS4ERR_NOSPC, | 2336 | | NFS4ERR_OFFLOAD_DENIED, NFS4ERR_OLD_STATEID, | 2337 | | NFS4ERR_OPENMODE, NFS4ERR_OP_NOT_IN_SESSION, | 2338 | | NFS4ERR_PARTNER_NO_AUTH, | 2339 | | NFS4ERR_PARTNER_NOTSUPP, NFS4ERR_PNFS_IO_HOLE, | 2340 | | NFS4ERR_PNFS_NO_LAYOUT, NFS4ERR_REP_TOO_BIG, | 2341 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2342 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2343 | | NFS4ERR_ROFS, NFS4ERR_SERVERFAULT, | 2344 | | NFS4ERR_STALE, NFS4ERR_SYMLINK, | 2345 | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | 2346 | COPY_NOTIFY | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | 2347 | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | 2348 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2349 | | NFS4ERR_DELEG_REVOKED, NFS4ERR_EXPIRED, | 2350 | | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, | 2351 | | NFS4ERR_ISDIR, NFS4ERR_IO, NFS4ERR_LOCKED, | 2352 | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | 2353 | | NFS4ERR_OLD_STATEID, NFS4ERR_OPENMODE, | 2354 | | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PNFS_IO_HOLE, | 2355 | | NFS4ERR_PNFS_NO_LAYOUT, NFS4ERR_REP_TOO_BIG, | 2356 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2357 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2358 | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | 2359 | | NFS4ERR_SYMLINK, NFS4ERR_TOO_MANY_OPS, | 2360 | | NFS4ERR_WRONG_TYPE | 2361 | DEALLOCATE | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | 2362 | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | 2363 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2364 | | NFS4ERR_DELEG_REVOKED, NFS4ERR_EXPIRED, | 2365 | | NFS4ERR_FBIG, NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, | 2366 | | NFS4ERR_INVAL, NFS4ERR_IO, NFS4ERR_ISDIR, | 2367 | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | 2368 | | NFS4ERR_NOTSUPP, NFS4ERR_OLD_STATEID, | 2369 | | NFS4ERR_OPENMODE, NFS4ERR_OP_NOT_IN_SESSION, | 2370 | | NFS4ERR_REP_TOO_BIG, | 2371 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2372 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2373 | | NFS4ERR_ROFS, NFS4ERR_SERVERFAULT, | 2374 | | NFS4ERR_STALE, NFS4ERR_SYMLINK, | 2375 | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | 2376 | GETDEVICELIST | NFS4ERR_NOTSUPP | 2377 | LAYOUTERROR | NFS4ERR_ADMIN_REVOKED, NFS4ERR_BADXDR, | 2378 | | NFS4ERR_BAD_STATEID, NFS4ERR_DEADSESSION, | 2379 | | NFS4ERR_DELAY, NFS4ERR_DELEG_REVOKED, | 2380 | | NFS4ERR_EXPIRED, NFS4ERR_FHEXPIRED, | 2381 | | NFS4ERR_GRACE, NFS4ERR_INVAL, NFS4ERR_ISDIR, | 2382 | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | 2383 | | NFS4ERR_NOTSUPP, NFS4ERR_NO_GRACE, | 2384 | | NFS4ERR_OLD_STATEID, NFS4ERR_OP_NOT_IN_SESSION, | 2385 | | NFS4ERR_REP_TOO_BIG, | 2386 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2387 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2388 | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | 2389 | | NFS4ERR_TOO_MANY_OPS, | 2390 | | NFS4ERR_UNKNOWN_LAYOUTTYPE, NFS4ERR_WRONG_CRED, | 2391 | | NFS4ERR_WRONG_TYPE | 2392 | LAYOUTSTATS | NFS4ERR_ADMIN_REVOKED, NFS4ERR_BADXDR, | 2393 | | NFS4ERR_BAD_STATEID, NFS4ERR_DEADSESSION, | 2394 | | NFS4ERR_DELAY, NFS4ERR_DELEG_REVOKED, | 2395 | | NFS4ERR_EXPIRED, NFS4ERR_FHEXPIRED, | 2396 | | NFS4ERR_GRACE, NFS4ERR_INVAL, NFS4ERR_ISDIR, | 2397 | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | 2398 | | NFS4ERR_NOTSUPP, NFS4ERR_NO_GRACE, | 2399 | | NFS4ERR_OLD_STATEID, NFS4ERR_OP_NOT_IN_SESSION, | 2400 | | NFS4ERR_REP_TOO_BIG, | 2401 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2402 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2403 | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | 2404 | | NFS4ERR_TOO_MANY_OPS, | 2405 | | NFS4ERR_UNKNOWN_LAYOUTTYPE, NFS4ERR_WRONG_CRED, | 2406 | | NFS4ERR_WRONG_TYPE | 2407 | OFFLOAD_CANCEL | NFS4ERR_ADMIN_REVOKED, NFS4ERR_BADXDR, | 2408 | | NFS4ERR_BAD_STATEID, NFS4ERR_COMPLETE_ALREADY, | 2409 | | NFS4ERR_DEADSESSION, NFS4ERR_EXPIRED, | 2410 | | NFS4ERR_DELAY, NFS4ERR_GRACE, NFS4ERR_NOTSUPP, | 2411 | | NFS4ERR_OLD_STATEID, NFS4ERR_OP_NOT_IN_SESSION, | 2412 | | NFS4ERR_SERVERFAULT, NFS4ERR_TOO_MANY_OPS | 2413 | OFFLOAD_STATUS | NFS4ERR_ADMIN_REVOKED, NFS4ERR_BADXDR, | 2414 | | NFS4ERR_BAD_STATEID, NFS4ERR_COMPLETE_ALREADY, | 2415 | | NFS4ERR_DEADSESSION, NFS4ERR_EXPIRED, | 2416 | | NFS4ERR_DELAY, NFS4ERR_GRACE, NFS4ERR_NOTSUPP, | 2417 | | NFS4ERR_OLD_STATEID, NFS4ERR_OP_NOT_IN_SESSION, | 2418 | | NFS4ERR_SERVERFAULT, NFS4ERR_TOO_MANY_OPS | 2419 | READ_PLUS | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | 2420 | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | 2421 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2422 | | NFS4ERR_DELEG_REVOKED, NFS4ERR_EXPIRED, | 2423 | | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, | 2424 | | NFS4ERR_ISDIR, NFS4ERR_IO, NFS4ERR_LOCKED, | 2425 | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | 2426 | | NFS4ERR_NOTSUPP, NFS4ERR_OLD_STATEID, | 2427 | | NFS4ERR_OPENMODE, NFS4ERR_OP_NOT_IN_SESSION, | 2428 | | NFS4ERR_PNFS_IO_HOLE, NFS4ERR_PNFS_NO_LAYOUT, | 2429 | | NFS4ERR_REP_TOO_BIG, | 2430 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2431 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2432 | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | 2433 | | NFS4ERR_SYMLINK, NFS4ERR_TOO_MANY_OPS, | 2434 | | NFS4ERR_WRONG_TYPE | 2435 | SEEK | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | 2436 | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | 2437 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2438 | | NFS4ERR_DELEG_REVOKED, NFS4ERR_EXPIRED, | 2439 | | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, | 2440 | | NFS4ERR_ISDIR, NFS4ERR_IO, NFS4ERR_LOCKED, | 2441 | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | 2442 | | NFS4ERR_NOTSUPP, NFS4ERR_OLD_STATEID, | 2443 | | NFS4ERR_OPENMODE, NFS4ERR_OP_NOT_IN_SESSION, | 2444 | | NFS4ERR_PNFS_IO_HOLE, NFS4ERR_PNFS_NO_LAYOUT, | 2445 | | NFS4ERR_REP_TOO_BIG, | 2446 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2447 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2448 | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | 2449 | | NFS4ERR_SYMLINK, NFS4ERR_TOO_MANY_OPS, | 2450 | | NFS4ERR_UNION_NOTSUPP, NFS4ERR_WRONG_TYPE | 2451 | SEQUENCE | NFS4ERR_BADSESSION, NFS4ERR_BADSLOT, | 2452 | | NFS4ERR_BADXDR, NFS4ERR_BAD_HIGH_SLOT, | 2453 | | NFS4ERR_CONN_NOT_BOUND_TO_SESSION, | 2454 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2455 | | NFS4ERR_REP_TOO_BIG, | 2456 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2457 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2458 | | NFS4ERR_SEQUENCE_POS, NFS4ERR_SEQ_FALSE_RETRY, | 2459 | | NFS4ERR_SEQ_MISORDERED, NFS4ERR_TOO_MANY_OPS | 2460 | WRITE_SAME | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | 2461 | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | 2462 | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | 2463 | | NFS4ERR_DELEG_REVOKED, NFS4ERR_DQUOT, | 2464 | | NFS4ERR_EXPIRED, NFS4ERR_FBIG, | 2465 | | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, | 2466 | | NFS4ERR_IO, NFS4ERR_ISDIR, NFS4ERR_LOCKED, | 2467 | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | 2468 | | NFS4ERR_NOSPC, NFS4ERR_NOTSUPP, | 2469 | | NFS4ERR_OLD_STATEID, NFS4ERR_OPENMODE, | 2470 | | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PNFS_IO_HOLE, | 2471 | | NFS4ERR_PNFS_NO_LAYOUT, NFS4ERR_REP_TOO_BIG, | 2472 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, | 2473 | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | 2474 | | NFS4ERR_ROFS, NFS4ERR_SERVERFAULT, | 2475 | | NFS4ERR_STALE, NFS4ERR_SYMLINK, | 2476 | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | 2477 +----------------+--------------------------------------------------+ 2479 Table 2 2481 12.3. New Callback Operations and Their Valid Errors 2483 This section contains a table that gives the valid error returns for 2484 each new NFSv4.2 callback operation. The error code NFS4_OK 2485 (indicating no error) is not listed but should be understood to be 2486 returnable by all new callback operations. The error values for all 2487 other callback operations are defined in Section 15.3 of [RFC5661]. 2489 Valid Error Returns for Each New Protocol Callback Operation 2491 +------------+------------------------------------------------------+ 2492 | Callback | Errors | 2493 | Operation | | 2494 +------------+------------------------------------------------------+ 2495 | CB_OFFLOAD | NFS4ERR_BADHANDLE, NFS4ERR_BADXDR, | 2496 | | NFS4ERR_BAD_STATEID, NFS4ERR_DELAY, | 2497 | | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_REP_TOO_BIG, | 2498 | | NFS4ERR_REP_TOO_BIG_TO_CACHE, NFS4ERR_REQ_TOO_BIG, | 2499 | | NFS4ERR_RETRY_UNCACHED_REP, NFS4ERR_SERVERFAULT, | 2500 | | NFS4ERR_TOO_MANY_OPS | 2501 +------------+------------------------------------------------------+ 2503 Table 3 2505 13. New File Attributes 2507 13.1. New RECOMMENDED Attributes - List and Definition References 2509 The list of new RECOMMENDED attributes appears in Table 4. The 2510 meaning of the columns of the table are: 2512 Name: The name of the attribute. 2514 Id: The number assigned to the attribute. In the event of conflicts 2515 between the assigned number and [NFSv42xdr], the latter is likely 2516 authoritative, but should be resolved with Errata to this document 2517 and/or [NFSv42xdr]. See [IESG08] for the Errata process. 2519 Data Type: The XDR data type of the attribute. 2521 Acc: Access allowed to the attribute. 2523 R means read-only (GETATTR may retrieve, SETATTR may not set). 2525 W means write-only (SETATTR may set, GETATTR may not retrieve). 2527 R W means read/write (GETATTR may retrieve, SETATTR may set). 2529 Defined in: The section of this specification that describes the 2530 attribute. 2532 +------------------+----+-------------------+-----+----------------+ 2533 | Name | Id | Data Type | Acc | Defined in | 2534 +------------------+----+-------------------+-----+----------------+ 2535 | space_freed | 77 | length4 | R | Section 13.2.3 | 2536 | change_attr_type | 78 | change_attr_type4 | R | Section 13.2.1 | 2537 | sec_label | 79 | sec_label4 | R W | Section 13.2.2 | 2538 +------------------+----+-------------------+-----+----------------+ 2540 Table 4 2542 13.2. Attribute Definitions 2544 13.2.1. Attribute 78: change_attr_type 2546 enum change_attr_type4 { 2547 NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR = 0, 2548 NFS4_CHANGE_TYPE_IS_VERSION_COUNTER = 1, 2549 NFS4_CHANGE_TYPE_IS_VERSION_COUNTER_NOPNFS = 2, 2550 NFS4_CHANGE_TYPE_IS_TIME_METADATA = 3, 2551 NFS4_CHANGE_TYPE_IS_UNDEFINED = 4 2552 }; 2554 change_attr_type is a per file system attribute which enables the 2555 NFSv4.2 server to provide additional information about how it expects 2556 the change attribute value to evolve after the file data, or metadata 2557 has changed. While Section 5.4 of [RFC5661] discusses per file 2558 system attributes, it is expected that the value of change_attr_type 2559 not depend on the value of "homogeneous" and only changes in the 2560 event of a migration. 2562 NFS4_CHANGE_TYPE_IS_UNDEFINED: The change attribute does not take 2563 values that fit into any of these categories. 2565 NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR: The change attribute value MUST 2566 monotonically increase for every atomic change to the file 2567 attributes, data, or directory contents. 2569 NFS4_CHANGE_TYPE_IS_VERSION_COUNTER: The change attribute value MUST 2570 be incremented by one unit for every atomic change to the file 2571 attributes, data, or directory contents. This property is 2572 preserved when writing to pNFS data servers. 2574 NFS4_CHANGE_TYPE_IS_VERSION_COUNTER_NOPNFS: The change attribute 2575 value MUST be incremented by one unit for every atomic change to 2576 the file attributes, data, or directory contents. In the case 2577 where the client is writing to pNFS data servers, the number of 2578 increments is not guaranteed to exactly match the number of 2579 writes. 2581 NFS4_CHANGE_TYPE_IS_TIME_METADATA: The change attribute is 2582 implemented as suggested in [I-D.ietf-nfsv4-rfc3530bis] in terms 2583 of the time_metadata attribute. 2585 If either NFS4_CHANGE_TYPE_IS_MONOTONIC_INCR, 2586 NFS4_CHANGE_TYPE_IS_VERSION_COUNTER, or 2587 NFS4_CHANGE_TYPE_IS_TIME_METADATA are set, then the client knows at 2588 the very least that the change attribute is monotonically increasing, 2589 which is sufficient to resolve the question of which value is the 2590 most recent. 2592 If the client sees the value NFS4_CHANGE_TYPE_IS_TIME_METADATA, then 2593 by inspecting the value of the 'time_delta' attribute it additionally 2594 has the option of detecting rogue server implementations that use 2595 time_metadata in violation of the spec. 2597 If the client sees NFS4_CHANGE_TYPE_IS_VERSION_COUNTER, it has the 2598 ability to predict what the resulting change attribute value should 2599 be after a COMPOUND containing a SETATTR, WRITE, or CREATE. This 2600 again allows it to detect changes made in parallel by another client. 2601 The value NFS4_CHANGE_TYPE_IS_VERSION_COUNTER_NOPNFS permits the 2602 same, but only if the client is not doing pNFS WRITEs. 2604 Finally, if the server does not support change_attr_type or if 2605 NFS4_CHANGE_TYPE_IS_UNDEFINED is set, then the server SHOULD make an 2606 effort to implement the change attribute in terms of the 2607 time_metadata attribute. 2609 13.2.2. Attribute 79: sec_label 2611 typedef uint32_t policy4; 2613 struct labelformat_spec4 { 2614 policy4 lfs_lfs; 2615 policy4 lfs_pi; 2616 }; 2618 struct sec_label4 { 2619 labelformat_spec4 slai_lfs; 2620 opaque slai_data<>; 2621 }; 2623 The FATTR4_SEC_LABEL contains an array of two components with the 2624 first component being an LFS. It serves to provide the receiving end 2625 with the information necessary to translate the security attribute 2626 into a form that is usable by the endpoint. Label Formats assigned 2627 an LFS may optionally choose to include a Policy Identifier field to 2628 allow for complex policy deployments. The LFS and Label Format 2629 Registry are described in detail in [Quigley14]. The translation 2630 used to interpret the security attribute is not specified as part of 2631 the protocol as it may depend on various factors. The second 2632 component is an opaque section which contains the data of the 2633 attribute. This component is dependent on the MAC model to interpret 2634 and enforce. 2636 In particular, it is the responsibility of the LFS specification to 2637 define a maximum size for the opaque section, slai_data<>. When 2638 creating or modifying a label for an object, the client needs to be 2639 guaranteed that the server will accept a label that is sized 2640 correctly. By both client and server being part of a specific MAC 2641 model, the client will be aware of the size. 2643 13.2.3. Attribute 77: space_freed 2645 space_freed gives the number of bytes freed if the file is deleted. 2646 This attribute is read only and is of type length4. It is a per file 2647 attribute. 2649 14. Operations: REQUIRED, RECOMMENDED, or OPTIONAL 2651 The following tables summarize the operations of the NFSv4.2 protocol 2652 and the corresponding designation of REQUIRED, RECOMMENDED, and 2653 OPTIONAL to implement or either OBSOLESCENT or MUST NOT implement. 2655 The designation of OBSOLESCENT is reserved for those operations which 2656 are defined in either NFSv4.0 or NFSv4.1 and are intended to be 2657 classified as MUST NOT be implemented in NFSv4.3. The designation of 2658 MUST NOT implement is reserved for those operations that were defined 2659 in either NFSv4.0 or NFSV4.1 and MUST NOT be implemented in NFSv4.2. 2661 For the most part, the REQUIRED, RECOMMENDED, or OPTIONAL designation 2662 for operations sent by the client is for the server implementation. 2663 The client is generally required to implement the operations needed 2664 for the operating environment for which it serves. For example, a 2665 read-only NFSv4.2 client would have no need to implement the WRITE 2666 operation and is not required to do so. 2668 The REQUIRED or OPTIONAL designation for callback operations sent by 2669 the server is for both the client and server. Generally, the client 2670 has the option of creating the backchannel and sending the operations 2671 on the fore channel that will be a catalyst for the server sending 2672 callback operations. A partial exception is CB_RECALL_SLOT; the only 2673 way the client can avoid supporting this operation is by not creating 2674 a backchannel. 2676 Since this is a summary of the operations and their designation, 2677 there are subtleties that are not presented here. Therefore, if 2678 there is a question of the requirements of implementation, the 2679 operation descriptions themselves must be consulted along with other 2680 relevant explanatory text within this either specification or that of 2681 NFSv4.1 [RFC5661]. 2683 The abbreviations used in the second and third columns of the table 2684 are defined as follows. 2686 REQ REQUIRED to implement 2688 REC RECOMMENDED to implement 2690 OPT OPTIONAL to implement 2692 MNI MUST NOT implement 2694 OBS Also OBSOLESCENT for future versions. 2696 For the NFSv4.2 features that are OPTIONAL, the operations that 2697 support those features are OPTIONAL, and the server would return 2698 NFS4ERR_NOTSUPP in response to the client's use of those operations. 2699 If an OPTIONAL feature is supported, it is possible that a set of 2700 operations related to the feature become REQUIRED to implement. The 2701 third column of the table designates the feature(s) and if the 2702 operation is REQUIRED or OPTIONAL in the presence of support for the 2703 feature. 2705 The OPTIONAL features identified and their abbreviations are as 2706 follows: 2708 pNFS Parallel NFS 2710 FDELG File Delegations 2712 DDELG Directory Delegations 2714 COPY Server Side Copy 2716 ADB Application Data Blocks 2718 Operations 2720 +----------------------+---------------------+----------------------+ 2721 | Operation | EOL, REQ, REC, OPT, | Feature (REQ, REC, | 2722 | | or MNI | or OPT) | 2723 +----------------------+---------------------+----------------------+ 2724 | ALLOCATE | OPT | | 2725 | ACCESS | REQ | | 2726 | BACKCHANNEL_CTL | REQ | | 2727 | BIND_CONN_TO_SESSION | REQ | | 2728 | CLOSE | REQ | | 2729 | COMMIT | REQ | | 2730 | COPY | OPT | COPY (REQ) | 2731 | COPY_NOTIFY | OPT | COPY (REQ) | 2732 | DEALLOCATE | OPT | | 2733 | CREATE | REQ | | 2734 | CREATE_SESSION | REQ | | 2735 | DELEGPURGE | OPT | FDELG (REQ) | 2736 | DELEGRETURN | OPT | FDELG, DDELG, pNFS | 2737 | | | (REQ) | 2738 | DESTROY_CLIENTID | REQ | | 2739 | DESTROY_SESSION | REQ | | 2740 | EXCHANGE_ID | REQ | | 2741 | FREE_STATEID | REQ | | 2742 | GETATTR | REQ | | 2743 | GETDEVICEINFO | OPT | pNFS (REQ) | 2744 | GETDEVICELIST | MNI | pNFS (MNI) | 2745 | GETFH | REQ | | 2746 | GET_DIR_DELEGATION | OPT | DDELG (REQ) | 2747 | LAYOUTCOMMIT | OPT | pNFS (REQ) | 2748 | LAYOUTGET | OPT | pNFS (REQ) | 2749 | LAYOUTRETURN | OPT | pNFS (REQ) | 2750 | LAYOUTERROR | OPT | pNFS (OPT) | 2751 | LAYOUTSTATS | OPT | pNFS (OPT) | 2752 | LINK | OPT | | 2753 | LOCK | REQ | | 2754 | LOCKT | REQ | | 2755 | LOCKU | REQ | | 2756 | LOOKUP | REQ | | 2757 | LOOKUPP | REQ | | 2758 | NVERIFY | REQ | | 2759 | OFFLOAD_CANCEL | OPT | COPY (REQ) | 2760 | OFFLOAD_STATUS | OPT | COPY (REQ) | 2761 | OPEN | REQ | | 2762 | OPENATTR | OPT | | 2763 | OPEN_CONFIRM | MNI | | 2764 | OPEN_DOWNGRADE | REQ | | 2765 | PUTFH | REQ | | 2766 | PUTPUBFH | REQ | | 2767 | PUTROOTFH | REQ | | 2768 | READ | REQ | | 2769 | READDIR | REQ | | 2770 | READLINK | OPT | | 2771 | READ_PLUS | OPT | | 2772 | RECLAIM_COMPLETE | REQ | | 2773 | RELEASE_LOCKOWNER | MNI | | 2774 | REMOVE | REQ | | 2775 | RENAME | REQ | | 2776 | RENEW | MNI | | 2777 | RESTOREFH | REQ | | 2778 | SAVEFH | REQ | | 2779 | SECINFO | REQ | | 2780 | SECINFO_NO_NAME | REC | pNFS file layout | 2781 | | | (REQ) | 2782 | SEQUENCE | REQ | | 2783 | SETATTR | REQ | | 2784 | SETCLIENTID | MNI | | 2785 | SETCLIENTID_CONFIRM | MNI | | 2786 | SET_SSV | REQ | | 2787 | TEST_STATEID | REQ | | 2788 | VERIFY | REQ | | 2789 | WANT_DELEGATION | OPT | FDELG (OPT) | 2790 | WRITE | REQ | | 2791 | WRITE_SAME | OPT | ADB (REQ) | 2792 +----------------------+---------------------+----------------------+ 2793 Callback Operations 2795 +-------------------------+-------------------+---------------------+ 2796 | Operation | REQ, REC, OPT, or | Feature (REQ, REC, | 2797 | | MNI | or OPT) | 2798 +-------------------------+-------------------+---------------------+ 2799 | CB_OFFLOAD | OPT | COPY (REQ) | 2800 | CB_GETATTR | OPT | FDELG (REQ) | 2801 | CB_LAYOUTRECALL | OPT | pNFS (REQ) | 2802 | CB_NOTIFY | OPT | DDELG (REQ) | 2803 | CB_NOTIFY_DEVICEID | OPT | pNFS (OPT) | 2804 | CB_NOTIFY_LOCK | OPT | | 2805 | CB_PUSH_DELEG | OPT | FDELG (OPT) | 2806 | CB_RECALL | OPT | FDELG, DDELG, pNFS | 2807 | | | (REQ) | 2808 | CB_RECALL_ANY | OPT | FDELG, DDELG, pNFS | 2809 | | | (REQ) | 2810 | CB_RECALL_SLOT | REQ | | 2811 | CB_RECALLABLE_OBJ_AVAIL | OPT | DDELG, pNFS (REQ) | 2812 | CB_SEQUENCE | OPT | FDELG, DDELG, pNFS | 2813 | | | (REQ) | 2814 | CB_WANTS_CANCELLED | OPT | FDELG, DDELG, pNFS | 2815 | | | (REQ) | 2816 +-------------------------+-------------------+---------------------+ 2818 15. Modifications to NFSv4.1 Operations 2820 15.1. Operation 42: EXCHANGE_ID - Instantiate Client ID 2822 15.1.1. ARGUMENT 2824 /* new */ 2825 const EXCHGID4_FLAG_SUPP_FENCE_OPS = 0x00000004; 2827 15.1.2. RESULT 2829 Unchanged 2831 15.1.3. MOTIVATION 2833 Enterprise applications require guarantees that an operation has 2834 either aborted or completed. NFSv4.1 provides this guarantee as long 2835 as the session is alive: simply send a SEQUENCE operation on the same 2836 slot with a new sequence number, and the successful return of 2837 SEQUENCE indicates the previous operation has completed. However, if 2838 the session is lost, there is no way to know when any in progress 2839 operations have aborted or completed. In hindsight, the NFSv4.1 2840 specification should have mandated that DESTROY_SESSION either abort 2841 or complete all outstanding operations. 2843 15.1.4. DESCRIPTION 2845 A client SHOULD request the EXCHGID4_FLAG_SUPP_FENCE_OPS capability 2846 when it sends an EXCHANGE_ID operation. The server SHOULD set this 2847 capability in the EXCHANGE_ID reply whether the client requests it or 2848 not. It is the server's return that determines whether this 2849 capability is in effect. When it is in effect, the following will 2850 occur: 2852 o The server will not reply to any DESTROY_SESSION invoked with the 2853 client ID until all operations in progress are completed or 2854 aborted. 2856 o The server will not reply to subsequent EXCHANGE_ID invoked on the 2857 same client owner with a new verifier until all operations in 2858 progress on the client ID's session are completed or aborted. 2860 o The NFS server SHOULD support client ID trunking, and if it does 2861 and the EXCHGID4_FLAG_SUPP_FENCE_OPS capability is enabled, then a 2862 session ID created on one node of the storage cluster MUST be 2863 destroyable via DESTROY_SESSION. In addition, DESTROY_CLIENTID 2864 and an EXCHANGE_ID with a new verifier affects all sessions 2865 regardless what node the sessions were created on. 2867 15.2. Operation 48: GETDEVICELIST - Get All Device Mappings for a File 2868 System 2870 15.2.1. ARGUMENT 2872 struct GETDEVICELIST4args { 2873 /* CURRENT_FH: object belonging to the file system */ 2874 layouttype4 gdla_layout_type; 2876 /* number of deviceIDs to return */ 2877 count4 gdla_maxdevices; 2879 nfs_cookie4 gdla_cookie; 2880 verifier4 gdla_cookieverf; 2881 }; 2883 15.2.2. RESULT 2885 struct GETDEVICELIST4resok { 2886 nfs_cookie4 gdlr_cookie; 2887 verifier4 gdlr_cookieverf; 2888 deviceid4 gdlr_deviceid_list<>; 2889 bool gdlr_eof; 2890 }; 2892 union GETDEVICELIST4res switch (nfsstat4 gdlr_status) { 2893 case NFS4_OK: 2894 GETDEVICELIST4resok gdlr_resok4; 2895 default: 2896 void; 2897 }; 2899 15.2.3. MOTIVATION 2901 The GETDEVICELIST operation was introduced in [RFC5661] specificly to 2902 request a list of devices at filesystem mount time from block layout 2903 type servers. However use of the GETDEVICELIST operation introduces 2904 a race condition versus notification about changes to pNFS device IDs 2905 as provided by CB_NOTIFY_DEVICEID. Implementation experience with 2906 block layout servers has shown there is no need for GETDEVICELIST. 2907 Clients have to be able to request new devices using GETDEVICEINFO at 2908 any time in response either to a new deviceid in LAYOUTGET results or 2909 to the CB_NOTIFY_DEVICEID callback operation. 2911 15.2.4. DESCRIPTION 2913 Clients and servers MUST NOT implement the GETDEVICELIST operation. 2915 16. NFSv4.2 Operations 2917 16.1. Operation 59: ALLOCATE - Reserve Space in A Region of a File 2919 16.1.1. ARGUMENT 2921 struct ALLOCATE4args { 2922 /* CURRENT_FH: file */ 2923 stateid4 aa_stateid; 2924 offset4 aa_offset; 2925 length4 aa_length; 2926 }; 2928 16.1.2. RESULT 2930 struct ALLOCATE4res { 2931 nfsstat4 ar_status; 2932 }; 2934 16.1.3. DESCRIPTION 2936 Whenever a client wishes to reserve space for a region in a file it 2937 calls the ALLOCATE operation with the current filehandle set to the 2938 filehandle of the file in question, and the start offset and length 2939 in bytes of the region set in aa_offset and aa_length respectively. 2941 The server will ensure that backing blocks are reserved to the region 2942 specified by aa_offset and aa_length, and that no future writes into 2943 this region will return NFS4ERR_NOSPC. If the region lies partially 2944 or fully outside the current file size the file size will be set to 2945 aa_offset + aa_length implicitly. If the server cannot guarantee 2946 this, it must return NFS4ERR_NOSPC. 2948 The ALLOCATE operation can also be used to extend the size of a file 2949 if the region specified by aa_offset and aa_length extends beyond the 2950 current file size. In that case any data outside of the previous 2951 file size will return zeroes when read before data is written to it. 2953 It is not required that the server allocate the space to the file 2954 before returning success. The allocation can be deferred, however, 2955 it must be guaranteed that it will not fail for lack of space. The 2956 deferral does not result in an asynchronous reply. 2958 The ALLOCATE operation will result in the space_used attribute and 2959 space_freed attributes being increased by the number of bytes 2960 reserved unless they were previously reserved or written and not 2961 shared. 2963 16.2. Operation 60: COPY - Initiate a server-side copy 2965 16.2.1. ARGUMENT 2966 struct COPY4args { 2967 /* SAVED_FH: source file */ 2968 /* CURRENT_FH: destination file */ 2969 stateid4 ca_src_stateid; 2970 stateid4 ca_dst_stateid; 2971 offset4 ca_src_offset; 2972 offset4 ca_dst_offset; 2973 length4 ca_count; 2974 bool ca_consecutive; 2975 bool ca_synchronous; 2976 netloc4 ca_source_server<>; 2977 }; 2979 16.2.2. RESULT 2981 struct write_response4 { 2982 stateid4 wr_callback_id<1>; 2983 length4 wr_count; 2984 stable_how4 wr_committed; 2985 verifier4 wr_writeverf; 2986 }; 2988 struct COPY4res { 2989 nfsstat4 cr_status; 2990 write_response4 cr_response; 2991 bool cr_consecutive; 2992 bool cr_synchronous; 2993 }; 2995 16.2.3. DESCRIPTION 2997 The COPY operation is used for both intra-server and inter-server 2998 copies. In both cases, the COPY is always sent from the client to 2999 the destination server of the file copy. The COPY operation requests 3000 that a file be copied from the location specified by the SAVED_FH 3001 value to the location specified by the CURRENT_FH. 3003 The SAVED_FH must be a regular file. If SAVED_FH is not a regular 3004 file, the operation MUST fail and return NFS4ERR_WRONG_TYPE. 3006 In order to set SAVED_FH to the source file handle, the compound 3007 procedure requesting the COPY will include a sub-sequence of 3008 operations such as 3009 PUTFH source-fh 3010 SAVEFH 3012 If the request is for a server-to-server copy, the source-fh is a 3013 filehandle from the source server and the compound procedure is being 3014 executed on the destination server. In this case, the source-fh is a 3015 foreign filehandle on the server receiving the COPY request. If 3016 either PUTFH or SAVEFH checked the validity of the filehandle, the 3017 operation would likely fail and return NFS4ERR_STALE. 3019 If a server supports the server-to-server COPY feature, a PUTFH 3020 followed by a SAVEFH MUST NOT return NFS4ERR_STALE for either 3021 operation. These restrictions do not pose substantial difficulties 3022 for servers. The CURRENT_FH and SAVED_FH may be validated in the 3023 context of the operation referencing them and an NFS4ERR_STALE error 3024 returned for an invalid file handle at that point. 3026 For an intra-server copy, both the ca_src_stateid and ca_dst_stateid 3027 MUST refer to either open or locking states provided earlier by the 3028 server. If either stateid is invalid, then the operation MUST fail. 3029 If the request is for a inter-server copy, then the ca_src_stateid 3030 can be ignored. If ca_dst_stateid is invalid, then the operation 3031 MUST fail. 3033 The CURRENT_FH specifies the destination of the copy operation. The 3034 CURRENT_FH MUST be a regular file and not a directory. Note, the 3035 file MUST exist before the COPY operation begins. It is the 3036 responsibility of the client to create the file if necessary, 3037 regardless of the actual copy protocol used. If the file cannot be 3038 created in the destination file system (due to file name 3039 restrictions, such as case or length), the COPY operation MUST NOT be 3040 called. 3042 The ca_src_offset is the offset within the source file from which the 3043 data will be read, the ca_dst_offset is the offset within the 3044 destination file to which the data will be written, and the ca_count 3045 is the number of bytes that will be copied. An offset of 0 (zero) 3046 specifies the start of the file. A count of 0 (zero) requests that 3047 all bytes from ca_src_offset through EOF be copied to the 3048 destination. If concurrent modifications to the source file overlap 3049 with the source file region being copied, the data copied may include 3050 all, some, or none of the modifications. The client can use standard 3051 NFS operations (e.g., OPEN with OPEN4_SHARE_DENY_WRITE or mandatory 3052 byte range locks) to protect against concurrent modifications if the 3053 client is concerned about this. If the source file's end of file is 3054 being modified in parallel with a copy that specifies a count of 0 3055 (zero) bytes, the amount of data copied is implementation dependent 3056 (clients may guard against this case by specifying a non-zero count 3057 value or preventing modification of the source file as mentioned 3058 above). 3060 If the source offset or the source offset plus count is greater than 3061 or equal to the size of the source file, the operation will fail with 3062 NFS4ERR_INVAL. The destination offset or destination offset plus 3063 count may be greater than the size of the destination file. This 3064 allows for the client to issue parallel copies to implement 3065 operations such as 3067 % cat file1 file2 file3 file4 > dest 3069 If the ca_source_server list is specified, then this is an inter- 3070 server copy operation and the source file is on a remote server. The 3071 client is expected to have previously issued a successful COPY_NOTIFY 3072 request to the remote source server. The ca_source_server list MUST 3073 be the same as the COPY_NOTIFY response's cnr_source_server list. If 3074 the client includes the entries from the COPY_NOTIFY response's 3075 cnr_source_server list in the ca_source_server list, the source 3076 server can indicate a specific copy protocol for the destination 3077 server to use by returning a URL, which specifies both a protocol 3078 service and server name. Server-to-server copy protocol 3079 considerations are described in Section 4.7 and Section 4.10.1. 3081 If ca_consecutive is set, then the client has specified that the copy 3082 protocol selected MUST copy bytes in consecutive order from 3083 ca_src_offset to ca_count. If the destination server cannot meet 3084 this requirement, then it MUST return an error of 3085 NFS4ERR_OFFLOAD_NO_REQS and set cr_consecutive to be false. 3086 Likewise, if ca_synchronous is set, then the client has required that 3087 the copy protocol selected MUST perform a synchronous copy. If the 3088 destination server cannot meet this requirement, then it MUST return 3089 an error of NFS4ERR_OFFLOAD_NO_REQS and set cr_synchronous to be 3090 false. 3092 If both are set by the client, then the destination SHOULD try to 3093 determine if it can respond to both requirements at the same time. 3094 If it cannot make that determination, it must set to false the one it 3095 can and set to true the other. The client, upon getting an 3096 NFS4ERR_OFFLOAD_NO_REQS error, has to examine both cr_consecutive and 3097 cr_synchronous against the respective values of ca_consecutive and 3098 ca_synchronous to determine the possible requirement not met. It 3099 MUST be prepared for the destination server not being able to 3100 determine both requirements at the same time. 3102 Upon receiving the NFS4ERR_OFFLOAD_NO_REQS error, the client has to 3103 determine if it wants to either re-request the copy with a relaxed 3104 set of requirements or if it wants to revert to manually copying the 3105 data. If it decides to manually copy the data and this is a remote 3106 copy, then the client is responsible for informing the source that 3107 the earlier COPY_NOTIFY is no longer valid by sending it an 3108 OFFLOAD_CANCEL. 3110 The copying of any and all attributes on the source file is the 3111 responsibility of both the client and the copy protocol. Any 3112 attribute which is both exposed via the NFS protocol on the source 3113 file and set SHOULD be copied to the destination file. Any attribute 3114 supported by the destination server that is not set on the source 3115 file SHOULD be left unset. If the client cannot copy an attribute 3116 from the source to destination, it MAY fail the copy transaction. 3118 Metadata attributes not exposed via the NFS protocol SHOULD be copied 3119 to the destination file where appropriate via the copy protocol. 3120 Note that if the copy protocol is NFSv4.x, then these attributes will 3121 be lost. 3123 The destination file's named attributes are not duplicated from the 3124 source file. After the copy process completes, the client MAY 3125 attempt to duplicate named attributes using standard NFSv4 3126 operations. However, the destination file's named attribute 3127 capabilities MAY be different from the source file's named attribute 3128 capabilities. 3130 If the operation does not result in an immediate failure, the server 3131 will return NFS4_OK, and the CURRENT_FH will remain the destination's 3132 filehandle. 3134 If the wr_callback_id is returned, this indicates that the operation 3135 was initiated and a CB_OFFLOAD callback will deliver the final 3136 results of the operation. The wr_callback_id stateid is termed a 3137 copy stateid in this context. The server is given the option of 3138 returning the results in a callback because the data may require a 3139 relatively long period of time to copy. 3141 If no wr_callback_id is returned, the operation completed 3142 synchronously and no callback will be issued by the server. The 3143 completion status of the operation is indicated by cr_status. 3145 If the copy completes successfully, either synchronously or 3146 asynchronously, the data copied from the source file to the 3147 destination file MUST appear identical to the NFS client. However, 3148 the NFS server's on disk representation of the data in the source 3149 file and destination file MAY differ. For example, the NFS server 3150 might encrypt, compress, deduplicate, or otherwise represent the on 3151 disk data in the source and destination file differently. 3153 If a failure does occur for a synchronous copy, wr_count will be set 3154 to the number of bytes copied to the destination file before the 3155 error occurred. If cr_consecutive is true, then the bytes were 3156 copied in order. If the failure occurred for an asynchronous copy, 3157 then the client will have gotten the notification of the consecutive 3158 copy order when it got the copy stateid. It will be able to 3159 determine the bytes copied from the coa_bytes_copied in the 3160 CB_OFFLOAD argument. 3162 In either case, if cr_consecutive was not true, there is no assurance 3163 as to exactly which bytes in the range were copied. The client MUST 3164 assume that there exists a mixture of the original contents of the 3165 range and the new bytes. If the COPY wrote past the end of the file 3166 on the destination, then the last byte written to will determine the 3167 new file size. The contents of any block not written to and past the 3168 original size of the file will be as if a normal WRITE extended the 3169 file. 3171 16.3. Operation 61: COPY_NOTIFY - Notify a source server of a future 3172 copy 3174 16.3.1. ARGUMENT 3176 struct COPY_NOTIFY4args { 3177 /* CURRENT_FH: source file */ 3178 stateid4 cna_src_stateid; 3179 netloc4 cna_destination_server; 3180 }; 3182 16.3.2. RESULT 3184 struct COPY_NOTIFY4resok { 3185 nfstime4 cnr_lease_time; 3186 netloc4 cnr_source_server<>; 3187 }; 3189 union COPY_NOTIFY4res switch (nfsstat4 cnr_status) { 3190 case NFS4_OK: 3191 COPY_NOTIFY4resok resok4; 3192 default: 3193 void; 3194 }; 3196 16.3.3. DESCRIPTION 3198 This operation is used for an inter-server copy. A client sends this 3199 operation in a COMPOUND request to the source server to authorize a 3200 destination server identified by cna_destination_server to read the 3201 file specified by CURRENT_FH on behalf of the given user. 3203 The cna_src_stateid MUST refer to either open or locking states 3204 provided earlier by the server. If it is invalid, then the operation 3205 MUST fail. 3207 The cna_destination_server MUST be specified using the netloc4 3208 network location format. The server is not required to resolve the 3209 cna_destination_server address before completing this operation. 3211 If this operation succeeds, the source server will allow the 3212 cna_destination_server to copy the specified file on behalf of the 3213 given user as long as both of the following conditions are met: 3215 o The destination server begins reading the source file before the 3216 cnr_lease_time expires. If the cnr_lease_time expires while the 3217 destination server is still reading the source file, the 3218 destination server is allowed to finish reading the file. 3220 o The client has not issued a COPY_REVOKE for the same combination 3221 of user, filehandle, and destination server. 3223 The cnr_lease_time is chosen by the source server. A cnr_lease_time 3224 of 0 (zero) indicates an infinite lease. To avoid the need for 3225 synchronized clocks, copy lease times are granted by the server as a 3226 time delta. To renew the copy lease time the client should resend 3227 the same copy notification request to the source server. 3229 A successful response will also contain a list of netloc4 network 3230 location formats called cnr_source_server, on which the source is 3231 willing to accept connections from the destination. These might not 3232 be reachable from the client and might be located on networks to 3233 which the client has no connection. 3235 For a copy only involving one server (the source and destination are 3236 on the same server), this operation is unnecessary. 3238 16.4. Operation 62: DEALLOCATE - Unreserve Space in a Region of a File 3239 16.4.1. ARGUMENT 3241 struct DEALLOCATE4args { 3242 /* CURRENT_FH: file */ 3243 stateid4 da_stateid; 3244 offset4 da_offset; 3245 length4 da_length; 3246 }; 3248 16.4.2. RESULT 3250 struct DEALLOCATE4res { 3251 nfsstat4 dr_status; 3252 }; 3254 16.4.3. DESCRIPTION 3256 Whenever a client wishes to unreserve space for a region in a file it 3257 calls the DEALLOCATE operation with the current filehandle set to the 3258 filehandle of the file in question, and the start offset and length 3259 in bytes of the region set in da_offset and da_length respectively. 3260 If no space was allocated or reserved for all or parts of the region, 3261 the DEALLOCATE operation will have no effect for the region that 3262 already is in unreserved state. All further reads from the region 3263 passed to DEALLOCATE MUST return zeros until overwritten. The 3264 filehandle specified must be that of a regular file. 3266 Situations may arise where da_offset and/or da_offset + da_length 3267 will not be aligned to a boundary for which the server does 3268 allocations or deallocations. For most file systems, this is the 3269 block size of the file system. In such a case, the server can 3270 deallocate as many bytes as it can in the region. The blocks that 3271 cannot be deallocated MUST be zeroed. 3273 DEALLOCATE will result in the space_used attribute being decreased by 3274 the number of bytes that were deallocated. The space_freed attribute 3275 may or may not decrease, depending on the support and whether the 3276 blocks backing the specified range were shared or not. The size 3277 attribute will remain unchanged. 3279 16.5. Operation 63: IO_ADVISE - Application I/O access pattern hints 3280 16.5.1. ARGUMENT 3282 enum IO_ADVISE_type4 { 3283 IO_ADVISE4_NORMAL = 0, 3284 IO_ADVISE4_SEQUENTIAL = 1, 3285 IO_ADVISE4_SEQUENTIAL_BACKWARDS = 2, 3286 IO_ADVISE4_RANDOM = 3, 3287 IO_ADVISE4_WILLNEED = 4, 3288 IO_ADVISE4_WILLNEED_OPPORTUNISTIC = 5, 3289 IO_ADVISE4_DONTNEED = 6, 3290 IO_ADVISE4_NOREUSE = 7, 3291 IO_ADVISE4_READ = 8, 3292 IO_ADVISE4_WRITE = 9, 3293 IO_ADVISE4_INIT_PROXIMITY = 10 3294 }; 3296 struct IO_ADVISE4args { 3297 /* CURRENT_FH: file */ 3298 stateid4 iaa_stateid; 3299 offset4 iaa_offset; 3300 length4 iaa_count; 3301 bitmap4 iaa_hints; 3302 }; 3304 16.5.2. RESULT 3306 struct IO_ADVISE4resok { 3307 bitmap4 ior_hints; 3308 }; 3310 union IO_ADVISE4res switch (nfsstat4 ior_status) { 3311 case NFS4_OK: 3312 IO_ADVISE4resok resok4; 3313 default: 3314 void; 3315 }; 3317 16.5.3. DESCRIPTION 3319 The IO_ADVISE operation sends an I/O access pattern hint to the 3320 server for the owner of the stateid for a given byte range specified 3321 by iar_offset and iar_count. The byte range specified by iaa_offset 3322 and iaa_count need not currently exist in the file, but the iaa_hints 3323 will apply to the byte range when it does exist. If iaa_count is 0, 3324 all data following iaa_offset is specified. The server MAY ignore 3325 the advice. 3327 The following are the allowed hints for a stateid holder: 3329 IO_ADVISE4_NORMAL There is no advice to give, this is the default 3330 behavior. 3332 IO_ADVISE4_SEQUENTIAL Expects to access the specified data 3333 sequentially from lower offsets to higher offsets. 3335 IO_ADVISE4_SEQUENTIAL_BACKWARDS Expects to access the specified data 3336 sequentially from higher offsets to lower offsets. 3338 IO_ADVISE4_RANDOM Expects to access the specified data in a random 3339 order. 3341 IO_ADVISE4_WILLNEED Expects to access the specified data in the near 3342 future. 3344 IO_ADVISE4_WILLNEED_OPPORTUNISTIC Expects to possibly access the 3345 data in the near future. This is a speculative hint, and 3346 therefore the server should prefetch data or indirect blocks only 3347 if it can be done at a marginal cost. 3349 IO_ADVISE_DONTNEED Expects that it will not access the specified 3350 data in the near future. 3352 IO_ADVISE_NOREUSE Expects to access the specified data once and then 3353 not reuse it thereafter. 3355 IO_ADVISE4_READ Expects to read the specified data in the near 3356 future. 3358 IO_ADVISE4_WRITE Expects to write the specified data in the near 3359 future. 3361 IO_ADVISE4_INIT_PROXIMITY Informs the server that the data in the 3362 byte range remains important to the client. 3364 Since IO_ADVISE is a hint, a server SHOULD NOT return an error and 3365 invalidate a entire Compound request if one of the sent hints in 3366 iar_hints is not supported by the server. Also, the server MUST NOT 3367 return an error if the client sends contradictory hints to the 3368 server, e.g., IO_ADVISE4_SEQUENTIAL and IO_ADVISE4_RANDOM in a single 3369 IO_ADVISE operation. In these cases, the server MUST return success 3370 and a ior_hints value that indicates the hint it intends to 3371 implement. This may mean simply returning IO_ADVISE4_NORMAL. 3373 The ior_hints returned by the server is primarily for debugging 3374 purposes since the server is under no obligation to carry out the 3375 hints that it describes in the ior_hints result. In addition, while 3376 the server may have intended to implement the hints returned in 3377 ior_hints, as time progresses, the server may need to change its 3378 handling of a given file due to several reasons including, but not 3379 limited to, memory pressure, additional IO_ADVISE hints sent by other 3380 clients, and heuristically detected file access patterns. 3382 The server MAY return different advice than what the client 3383 requested. If it does, then this might be due to one of several 3384 conditions, including, but not limited to another client advising of 3385 a different I/O access pattern; a different I/O access pattern from 3386 another client that that the server has heuristically detected; or 3387 the server is not able to support the requested I/O access pattern, 3388 perhaps due to a temporary resource limitation. 3390 Each issuance of the IO_ADVISE operation overrides all previous 3391 issuances of IO_ADVISE for a given byte range. This effectively 3392 follows a strategy of last hint wins for a given stateid and byte 3393 range. 3395 Clients should assume that hints included in an IO_ADVISE operation 3396 will be forgotten once the file is closed. 3398 16.5.4. IMPLEMENTATION 3400 The NFS client may choose to issue an IO_ADVISE operation to the 3401 server in several different instances. 3403 The most obvious is in direct response to an application's execution 3404 of posix_fadvise(). In this case, IO_ADVISE4_WRITE and 3405 IO_ADVISE4_READ may be set based upon the type of file access 3406 specified when the file was opened. 3408 16.5.5. IO_ADVISE4_INIT_PROXIMITY 3410 The IO_ADVISE4_INIT_PROXIMITY hint is non-posix in origin and can be 3411 used to convey that the client has recently accessed the byte range 3412 in its own cache. I.e., it has not accessed it on the server, but it 3413 has locally. When the server reaches resource exhaustion, knowing 3414 which data is more important allows the server to make better choices 3415 about which data to, for example purge from a cache, or move to 3416 secondary storage. It also informs the server which delegations are 3417 more important, since if delegations are working correctly, once 3418 delegated to a client and the client has read the content for that 3419 byte range, a server might never receive another read request for 3420 that byte range. 3422 The IO_ADVISE4_INIT_PROXIMITY hint can also be used in a pNFS setting 3423 to let the client inform the metadata server as to the I/O statistics 3424 between the client and the storage devices. The metadata server is 3425 then free to use this information about client I/O to optimize the 3426 data storage location. 3428 This hint is also useful in the case of NFS clients which are network 3429 booting from a server. If the first client to be booted sends this 3430 hint, then it keeps the cache warm for the remaining clients. 3432 16.5.6. pNFS File Layout Data Type Considerations 3434 The IO_ADVISE considerations for pNFS are very similar to the COMMIT 3435 considerations for pNFS. That is, as with COMMIT, some NFS server 3436 implementations prefer IO_ADVISE be done on the DS, and some prefer 3437 it be done on the MDS. 3439 For the file's layout type, it is proposed that NFSv4.2 include an 3440 additional hint NFL42_CARE_IO_ADVISE_THRU_MDS which is valid only on 3441 metadata servers running NFSv4.2 or higher. Any file's layout 3442 obtained from a NFSv4.1 metadata server MUST NOT have 3443 NFL42_UFLG_IO_ADVISE_THRU_MDS set. Any file's layout obtained with a 3444 NFSv4.2 metadata server MAY have NFL42_UFLG_IO_ADVISE_THRU_MDS set. 3445 However, if the layout utilizes NFSv4.1 storage devices, the 3446 IO_ADVISE operation cannot be sent to them. 3448 If NFL42_UFLG_IO_ADVISE_THRU_MDS is set, the client MUST send the 3449 IO_ADVISE operation to the MDS in order for it to be honored by the 3450 DS. Once the MDS receives the IO_ADVISE operation, it will 3451 communicate the advice to each DS. 3453 If NFL42_UFLG_IO_ADVISE_THRU_MDS is not set, then the client SHOULD 3454 send an IO_ADVISE operation to the appropriate DS for the specified 3455 byte range. While the client MAY always send IO_ADVISE to the MDS, 3456 if the server has not set NFL42_UFLG_IO_ADVISE_THRU_MDS, the client 3457 should expect that such an IO_ADVISE is futile. Note that a client 3458 SHOULD use the same set of arguments on each IO_ADVISE sent to a DS 3459 for the same open file reference. 3461 The server is not required to support different advice for different 3462 DS's with the same open file reference. 3464 16.5.6.1. Dense and Sparse Packing Considerations 3466 The IO_ADVISE operation MUST use the iar_offset and byte range as 3467 dictated by the presence or absence of NFL4_UFLG_DENSE. 3469 E.g., if NFL4_UFLG_DENSE is present, and a READ or WRITE to the DS 3470 for iaa_offset 0 really means iaa_offset 10000 in the logical file, 3471 then an IO_ADVISE for iaa_offset 0 means iaa_offset 10000. 3473 E.g., if NFL4_UFLG_DENSE is absent, then a READ or WRITE to the DS 3474 for iaa_offset 0 really means iaa_offset 0 in the logical file, then 3475 an IO_ADVISE for iaa_offset 0 means iaa_offset 0 in the logical file. 3477 E.g., if NFL4_UFLG_DENSE is present, the stripe unit is 1000 bytes 3478 and the stripe count is 10, and the dense DS file is serving 3479 iar_offset 0. A READ or WRITE to the DS for iaa_offsets 0, 1000, 3480 2000, and 3000, really mean iaa_offsets 10000, 20000, 30000, and 3481 40000 (implying a stripe count of 10 and a stripe unit of 1000), then 3482 an IO_ADVISE sent to the same DS with an iaa_offset of 500, and an 3483 iaa_count of 3000 means that the IO_ADVISE applies to these byte 3484 ranges of the dense DS file: 3486 - 500 to 999 3487 - 1000 to 1999 3488 - 2000 to 2999 3489 - 3000 to 3499 3491 I.e., the contiguous range 500 to 3499 as specified in IO_ADVISE. 3493 It also applies to these byte ranges of the logical file: 3495 - 10500 to 10999 (500 bytes) 3496 - 20000 to 20999 (1000 bytes) 3497 - 30000 to 30999 (1000 bytes) 3498 - 40000 to 40499 (500 bytes) 3499 (total 3000 bytes) 3501 E.g., if NFL4_UFLG_DENSE is absent, the stripe unit is 250 bytes, the 3502 stripe count is 4, and the sparse DS file is serving iaa_offset 0. 3503 Then a READ or WRITE to the DS for iaa_offsets 0, 1000, 2000, and 3504 3000, really means iaa_offsets 0, 1000, 2000, and 3000 in the logical 3505 file, keeping in mind that on the DS file, byte ranges 250 to 999, 3506 1250 to 1999, 2250 to 2999, and 3250 to 3999 are not accessible. 3507 Then an IO_ADVISE sent to the same DS with an iaa_offset of 500, and 3508 a iaa_count of 3000 means that the IO_ADVISE applies to these byte 3509 ranges of the logical file and the sparse DS file: 3511 - 500 to 999 (500 bytes) - no effect 3512 - 1000 to 1249 (250 bytes) - effective 3513 - 1250 to 1999 (750 bytes) - no effect 3514 - 2000 to 2249 (250 bytes) - effective 3515 - 2250 to 2999 (750 bytes) - no effect 3516 - 3000 to 3249 (250 bytes) - effective 3517 - 3250 to 3499 (250 bytes) - no effect 3518 (subtotal 2250 bytes) - no effect 3519 (subtotal 750 bytes) - effective 3520 (grand total 3000 bytes) - no effect + effective 3522 If neither of the flags NFL42_UFLG_IO_ADVISE_THRU_MDS and 3523 NFL4_UFLG_DENSE are set in the layout, then any IO_ADVISE request 3524 sent to the data server with a byte range that overlaps stripe unit 3525 that the data server does not serve MUST NOT result in the status 3526 NFS4ERR_PNFS_IO_HOLE. Instead, the response SHOULD be successful and 3527 if the server applies IO_ADVISE hints on any stripe units that 3528 overlap with the specified range, those hints SHOULD be indicated in 3529 the response. 3531 16.6. Operation 64: LAYOUTERROR - Provide Errors for the Layout 3533 16.6.1. ARGUMENT 3535 struct device_error4 { 3536 deviceid4 de_deviceid; 3537 nfsstat4 de_status; 3538 nfs_opnum4 de_opnum; 3539 }; 3541 struct LAYOUTERROR4args { 3542 /* CURRENT_FH: file */ 3543 offset4 lea_offset; 3544 length4 lea_length; 3545 stateid4 lea_stateid; 3546 device_error4 lea_errors; 3547 }; 3549 16.6.2. RESULT 3551 struct LAYOUTERROR4res { 3552 nfsstat4 ler_status; 3553 }; 3555 16.6.3. DESCRIPTION 3557 The client can use LAYOUTERROR to inform the metadata server about 3558 errors in its interaction with the layout represented by the current 3559 filehandle, client ID (derived from the session ID in the preceding 3560 SEQUENCE operation), byte-range (lea_offset + lea_length), and 3561 lea_stateid. 3563 Each individual device_error4 describes a single error associated 3564 with a storage device, which is identified via de_deviceid. If the 3565 Layout Type supports NFSv4 operations, then the operation which 3566 returned the error is identified via de_opnum. If the Layout Type 3567 does not support NFSv4 operations, then it MAY chose to either map 3568 the operation onto one of the allowed operations which can be sent to 3569 a storage device with the File Layout Type (see Section 3.3) or it 3570 can signal no support for operations by marking de_opnum with the 3571 ILLEGAL operation. Finally the NFS error value (nfsstat4) 3572 encountered is provided via de_status and may consist of the 3573 following error codes: 3575 NFS4ERR_NXIO: The client was unable to establish any communication 3576 with the storage device. 3578 NFS4ERR_*: The client was able to establish communication with the 3579 storage device and is returning one of the allowed error codes for 3580 the operation denoted by de_opnum. 3582 Note that while the metadata server may return an error associated 3583 with the layout stateid or the open file, it MUST NOT return an error 3584 in the processing of the errors. If LAYOUTERROR is in a compound 3585 before LAYOUTRETURN, it MUST NOT introduce an error other than what 3586 LAYOUTRETURN would already encounter. 3588 16.6.4. IMPLEMENTATION 3590 There are two broad classes of errors, transient and persistent. The 3591 client SHOULD strive to only use this new mechanism to report 3592 persistent errors. It MUST be able to deal with transient issues by 3593 itself. Also, while the client might consider an issue to be 3594 persistent, it MUST be prepared for the metadata server to consider 3595 such issues to be transient. A prime example of this is if the 3596 metadata server fences off a client from either a stateid or a 3597 filehandle. The client will get an error from the storage device and 3598 might relay either NFS4ERR_ACCESS or NFS4ERR_BAD_STATEID back to the 3599 metadata server, with the belief that this is a hard error. If the 3600 metadata server is informed by the client that there is an error, it 3601 can safely ignore that. For it, the mission is accomplished in that 3602 the client has returned a layout that the metadata server had most 3603 likely recalled. 3605 The client might also need to inform the metadata server that it 3606 cannot reach one or more of the storage devices. While the metadata 3607 server can detect the connectivity of both of these paths: 3609 o metadata server to storage device 3611 o metadata server to client 3613 it cannot determine if the client and storage device path is working. 3614 As with the case of the storage device passing errors to the client, 3615 it must be prepared for the metadata server to consider such outages 3616 as being transitory. 3618 Clients are expected to tolerate transient storage device errors, and 3619 hence clients SHOULD NOT use the LAYOUTERROR error handling for 3620 device access problems that may be transient. The methods by which a 3621 client decides whether a device access problem is transient vs 3622 persistent are implementation-specific, but may include retrying I/Os 3623 to a data server under appropriate conditions. 3625 When an I/O fails to a storage device, the client SHOULD retry the 3626 failed I/O via the metadata server. In this situation, before 3627 retrying the I/O, the client SHOULD return the layout, or the 3628 affected portion thereof, and SHOULD indicate which storage device or 3629 devices was problematic. The client needs to do this when the 3630 storage device is being unresponsive in order to fence off any failed 3631 write attempts, and ensure that they do not end up overwriting any 3632 later data being written through the metadata server. If the client 3633 does not do this, the metadata server MAY issue a layout recall 3634 callback in order to perform the retried I/O. 3636 The client needs to be cognizant that since this error handling is 3637 optional in the metadata server, the metadata server may silently 3638 ignore this functionality. Also, as the metadata server may consider 3639 some issues the client reports to be expected, the client might find 3640 it difficult to detect a metadata server which has not implemented 3641 error handling via LAYOUTERROR. 3643 If an metadata server is aware that a storage device is proving 3644 problematic to a client, the metadata server SHOULD NOT include that 3645 storage device in any pNFS layouts sent to that client. If the 3646 metadata server is aware that a storage device is affecting many 3647 clients, then the metadata server SHOULD NOT include that storage 3648 device in any pNFS layouts sent out. If a client asks for a new 3649 layout for the file from the metadata server, it MUST be prepared for 3650 the metadata server to return that storage device in the layout. The 3651 metadata server might not have any choice in using the storage 3652 device, i.e., there might only be one possible layout for the system. 3653 Also, in the case of existing files, the metadata server might have 3654 no choice in which storage devices to hand out to clients. 3656 The metadata server is not required to indefinitely retain per-client 3657 storage device error information. An metadata server is also not 3658 required to automatically reinstate use of a previously problematic 3659 storage device; administrative intervention may be required instead. 3661 16.7. Operation 65: LAYOUTSTATS - Provide Statistics for the Layout 3663 16.7.1. ARGUMENT 3665 struct layoutupdate4 { 3666 layouttype4 lou_type; 3667 opaque lou_body<>; 3668 }; 3670 struct io_info4 { 3671 uint32_t ii_count; 3672 uint64_t ii_bytes; 3673 }; 3675 struct LAYOUTSTATS4args { 3676 /* CURRENT_FH: file */ 3677 offset4 lsa_offset; 3678 length4 lsa_length; 3679 stateid4 lsa_stateid; 3680 io_info4 lsa_read; 3681 io_info4 lsa_write; 3682 layoutupdate4 lsa_layoutupdate; 3683 }; 3685 16.7.2. RESULT 3687 struct LAYOUTSTATS4res { 3688 nfsstat4 lsr_status; 3689 }; 3691 16.7.3. DESCRIPTION 3693 The client can use LAYOUTSTATS to inform the metadata server about 3694 its interaction with the layout represented by the current 3695 filehandle, client ID (derived from the session ID in the preceding 3696 SEQUENCE operation), byte-range (lea_offset + lea_length), and 3697 lea_stateid. lsa_read and lsa_write allow for non-Layout Type 3698 specific statistics to be reported. The remaining information the 3699 client is presenting is specific to the Layout Type and presented in 3700 the lea_layoutupdate field. Each Layout Type MUST define the 3701 contents of lea_layoutupdate in their respective specifications. 3703 LAYOUTSTATS can be combined with IO_ADVISE (see Section 16.5) to 3704 augment the decision making process of how the metadata server 3705 handles a file. I.e., IO_ADVISE lets the server know that a byte 3706 range has a certain characteristic, but not necessarily the intensity 3707 of that characteristic. 3709 The client MUST reset the statistics after getting a successfully 3710 reply from the metadata server. The first LAYOUTSTATS sent by the 3711 client SHOULD be from the opening of the file. The choice of how 3712 often to update the metadata server is made by the client. 3714 Note that while the metadata server may return an error associated 3715 with the layout stateid or the open file, it MUST NOT return an error 3716 in the processing of the statistics. 3718 16.8. Operation 66: OFFLOAD_CANCEL - Stop an Offloaded Operation 3720 16.8.1. ARGUMENT 3722 struct OFFLOAD_CANCEL4args { 3723 /* CURRENT_FH: file to cancel */ 3724 stateid4 oca_stateid; 3725 }; 3727 16.8.2. RESULT 3729 struct OFFLOAD_CANCEL4res { 3730 nfsstat4 ocr_status; 3731 }; 3733 16.8.3. DESCRIPTION 3735 OFFLOAD_CANCEL is used by the client to terminate an asynchronous 3736 operation, which is identified both by CURRENT_FH and the 3737 oca_stateid. I.e., there can be multiple offloaded operations acting 3738 on the file, the stateid will identify to the server exactly which 3739 one is to be stopped. Currently there are only two operations which 3740 can decide to be asynchronous: COPY and WRITE_SAME. 3742 In the context of server-to-server copy, the client can send 3743 OFFLOAD_CANCEL to either the source or destination server, albeit 3744 with a different stateid. The client uses OFFLOAD_CANCEL to inform 3745 the destination to stop the active transfer and uses the stateid it 3746 got back from the COPY operation. The client uses OFFLOAD_CANCEL and 3747 the stateid it used in the COPY_NOTIFY to inform the source to not 3748 allow any more copying from the destination. 3750 OFFLOAD_CANCEL is also useful in situations in which the source 3751 server granted a very long or infinite lease on the destination 3752 server's ability to read the source file and all copy operations on 3753 the source file have been completed. 3755 16.9. Operation 67: OFFLOAD_STATUS - Poll for Status of Asynchronous 3756 Operation 3758 16.9.1. ARGUMENT 3760 struct OFFLOAD_STATUS4args { 3761 /* CURRENT_FH: destination file */ 3762 stateid4 osa_stateid; 3763 }; 3765 16.9.2. RESULT 3767 struct OFFLOAD_STATUS4resok { 3768 length4 osr_count; 3769 nfsstat4 osr_complete<1>; 3770 }; 3772 union OFFLOAD_STATUS4res switch (nfsstat4 osr_status) { 3773 case NFS4_OK: 3774 OFFLOAD_STATUS4resok osr_resok4; 3775 default: 3776 void; 3777 }; 3779 16.9.3. DESCRIPTION 3781 OFFLOAD_STATUS can be used by the client to query the progress of an 3782 asynchronous operation, which is identified both by CURRENT_FH and 3783 the osa_stateid. If this operation is successful, the number of 3784 bytes processed are returned to the client in the osr_count field. 3786 If the optional osr_complete field is present, the asynchronous 3787 operation has completed. In this case the status value indicates the 3788 result of the asynchronous operation. In all cases, the server will 3789 also deliver the final results of the asynchronous operation in a 3790 CB_OFFLOAD operation. 3792 The failure of this operation does not indicate the result of the 3793 asynchronous operation in any way. 3795 16.10. Operation 68: READ_PLUS - READ Data or Holes from a File 3797 16.10.1. ARGUMENT 3799 struct READ_PLUS4args { 3800 /* CURRENT_FH: file */ 3801 stateid4 rpa_stateid; 3802 offset4 rpa_offset; 3803 count4 rpa_count; 3804 }; 3806 16.10.2. RESULT 3808 enum data_content4 { 3809 NFS4_CONTENT_DATA = 0, 3810 NFS4_CONTENT_HOLE = 1 3811 }; 3813 struct data_info4 { 3814 offset4 di_offset; 3815 length4 di_length; 3816 }; 3818 struct data4 { 3819 offset4 d_offset; 3820 opaque d_data<>; 3821 }; 3822 union read_plus_content switch (data_content4 rpc_content) { 3823 case NFS4_CONTENT_DATA: 3824 data4 rpc_data; 3825 case NFS4_CONTENT_HOLE: 3826 data_info4 rpc_hole; 3827 default: 3828 void; 3829 }; 3831 /* 3832 * Allow a return of an array of contents. 3833 */ 3834 struct read_plus_res4 { 3835 bool rpr_eof; 3836 read_plus_content rpr_contents<>; 3837 }; 3839 union READ_PLUS4res switch (nfsstat4 rp_status) { 3840 case NFS4_OK: 3841 read_plus_res4 rp_resok4; 3842 default: 3843 void; 3844 }; 3846 16.10.3. DESCRIPTION 3848 The READ_PLUS operation is based upon the NFSv4.1 READ operation (see 3849 Section 18.22 of [RFC5661]) and similarly reads data from the regular 3850 file identified by the current filehandle. 3852 The client provides a rpa_offset of where the READ_PLUS is to start 3853 and a rpa_count of how many bytes are to be read. A rpa_offset of 3854 zero means to read data starting at the beginning of the file. If 3855 rpa_offset is greater than or equal to the size of the file, the 3856 status NFS4_OK is returned with di_length (the data length) set to 3857 zero and eof set to TRUE. 3859 The READ_PLUS result is comprised of an array of rpr_contents, each 3860 of which describe a data_content4 type of data. For NFSv4.2, the 3861 allowed values are data and hole. A server MUST support both the 3862 data type and the hole if it uses READ_PLUS. If it does not want to 3863 support a hole, it MUST use READ. The array contents MUST be 3864 contiguous in the file. 3866 Holes SHOULD be returned in their entirety - clients must be prepared 3867 to get more information than they requested. Both the start and the 3868 end of the hole may exceed what was requested. If data to be 3869 returned is comprised entirely of zeros, then the server SHOULD 3870 return that data as a hole instead. 3872 The server may elect to return adjacent elements of the same type. 3873 For example, if the server has a range of data comprised entirely of 3874 zeros and then a hole, it might want to return two adjacent holes to 3875 the client. 3877 If the client specifies a rpa_count value of zero, the READ_PLUS 3878 succeeds and returns zero bytes of data. In all situations, the 3879 server may choose to return fewer bytes than specified by the client. 3880 The client needs to check for this condition and handle the condition 3881 appropriately. 3883 If the client specifies an rpa_offset and rpa_count value that is 3884 entirely contained within a hole of the file, then the di_offset and 3885 di_length returned MAY be for the entire hole. If the the owner has 3886 a locked byte range covering rpa_offset and rpa_count entirely the 3887 di_offset and di_length MUST NOT be extended outside the locked byte 3888 range. This result is considered valid until the file is changed 3889 (detected via the change attribute). The server MUST provide the 3890 same semantics for the hole as if the client read the region and 3891 received zeroes; the implied holes contents lifetime MUST be exactly 3892 the same as any other read data. 3894 If the client specifies an rpa_offset and rpa_count value that begins 3895 in a non-hole of the file but extends into hole the server should 3896 return an array comprised of both data and a hole. The client MUST 3897 be prepared for the server to return a short read describing just the 3898 data. The client will then issue another READ_PLUS for the remaining 3899 bytes, which the server will respond with information about the hole 3900 in the file. 3902 Except when special stateids are used, the stateid value for a 3903 READ_PLUS request represents a value returned from a previous byte- 3904 range lock or share reservation request or the stateid associated 3905 with a delegation. The stateid identifies the associated owners if 3906 any and is used by the server to verify that the associated locks are 3907 still valid (e.g., have not been revoked). 3909 If the read ended at the end-of-file (formally, in a correctly formed 3910 READ_PLUS operation, if rpa_offset + rpa_count is equal to the size 3911 of the file), or the READ_PLUS operation extends beyond the size of 3912 the file (if rpa_offset + rpa_count is greater than the size of the 3913 file), eof is returned as TRUE; otherwise, it is FALSE. A successful 3914 READ_PLUS of an empty file will always return eof as TRUE. 3916 If the current filehandle is not an ordinary file, an error will be 3917 returned to the client. In the case that the current filehandle 3918 represents an object of type NF4DIR, NFS4ERR_ISDIR is returned. If 3919 the current filehandle designates a symbolic link, NFS4ERR_SYMLINK is 3920 returned. In all other cases, NFS4ERR_WRONG_TYPE is returned. 3922 For a READ_PLUS with a stateid value of all bits equal to zero, the 3923 server MAY allow the READ_PLUS to be serviced subject to mandatory 3924 byte-range locks or the current share deny modes for the file. For a 3925 READ_PLUS with a stateid value of all bits equal to one, the server 3926 MAY allow READ_PLUS operations to bypass locking checks at the 3927 server. 3929 On success, the current filehandle retains its value. 3931 16.10.3.1. Note on Client Support of Arms of the Union 3933 It was decided not to add a means for the client to inform the server 3934 as to which arms of READ_PLUS it would support. In a later minor 3935 version, it may become necessary for the introduction of a new 3936 operation which would allow the client to inform the server as to 3937 whether it supported the new arms of the union of data types 3938 available in READ_PLUS. 3940 16.10.4. IMPLEMENTATION 3942 In general, the IMPLEMENTATION notes for READ in Section 18.22.4 of 3943 [RFC5661] also apply to READ_PLUS. 3945 16.10.4.1. Additional pNFS Implementation Information 3947 With pNFS, the semantics of using READ_PLUS remains the same. Any 3948 data server MAY return a hole result for a READ_PLUS request that it 3949 receives. When a data server chooses to return such a result, it has 3950 the option of returning information for the data stored on that data 3951 server (as defined by the data layout), but it MUST NOT return 3952 results for a byte range that includes data managed by another data 3953 server. 3955 If mandatory locking is enforced, then the data server must also 3956 ensure that to return only information that is within the owner's 3957 locked byte range. 3959 16.10.5. READ_PLUS with Sparse Files Example 3961 The following table describes a sparse file. For each byte range, 3962 the file contains either non-zero data or a hole. In addition, the 3963 server in this example will only create a hole if it is greater than 3964 32K. 3966 +-------------+----------+ 3967 | Byte-Range | Contents | 3968 +-------------+----------+ 3969 | 0-15999 | Hole | 3970 | 16K-31999 | Non-Zero | 3971 | 32K-255999 | Hole | 3972 | 256K-287999 | Non-Zero | 3973 | 288K-353999 | Hole | 3974 | 354K-417999 | Non-Zero | 3975 +-------------+----------+ 3977 Table 5 3979 Under the given circumstances, if a client was to read from the file 3980 with a max read size of 64K, the following will be the results for 3981 the given READ_PLUS calls. This assumes the client has already 3982 opened the file, acquired a valid stateid ('s' in the example), and 3983 just needs to issue READ_PLUS requests. 3985 1. READ_PLUS(s, 0, 64K) --> NFS_OK, eof = false, . Since the first hole is less than the server's 3987 minimum hole size, the first 32K of the file is returned as data 3988 and the remaining 32K is returned as a hole which actually 3989 extends to 256K. 3991 2. READ_PLUS(s, 32K, 64K) --> NFS_OK, eof = false, 3992 The requested range was all zeros, and the current hole begins at 3993 offset 32K and is 224K in length. Note that the client should 3994 not have followed up the previous READ_PLUS request with this one 3995 as the hole information from the previous call extended past what 3996 the client was requesting. 3998 3. READ_PLUS(s, 256K, 64K) --> NFS_OK, eof = false, . Returns an array of the 32K data and 4000 the hole which extends to 354K. 4002 4. READ_PLUS(s, 354K, 64K) --> NFS_OK, eof = true, . Returns the final 64K of data and informs the client 4004 there is no more data in the file. 4006 16.11. Operation 69: SEEK - Find the Next Data or Hole 4008 16.11.1. ARGUMENT 4010 enum data_content4 { 4011 NFS4_CONTENT_DATA = 0, 4012 NFS4_CONTENT_HOLE = 1 4013 }; 4015 struct SEEK4args { 4016 /* CURRENT_FH: file */ 4017 stateid4 sa_stateid; 4018 offset4 sa_offset; 4019 data_content4 sa_what; 4020 }; 4022 16.11.2. RESULT 4024 struct seek_res4 { 4025 bool sr_eof; 4026 offset4 sr_offset; 4027 }; 4029 union SEEK4res switch (nfsstat4 sa_status) { 4030 case NFS4_OK: 4031 seek_res4 resok4; 4032 default: 4033 void; 4034 }; 4036 16.11.3. DESCRIPTION 4038 SEEK is an operation that allows a client to determine the location 4039 of the next data_content4 in a file. It allows an implementation of 4040 the emerging extension to lseek(2) to allow clients to determine the 4041 next hole whilst in data or the next data whilst in a hole. 4043 From the given sa_offset, find the next data_content4 of type sa_what 4044 in the file. If the server can not find a corresponding sa_what, 4045 then the status will still be NFS4_OK, but sr_eof would be TRUE. If 4046 the server can find the sa_what, then the sr_offset is the start of 4047 that content. If the sa_offset is beyond the end of the file, then 4048 SEEK MUST return NFS4ERR_NXIO. 4050 All files MUST have a virtual hole at the end of the file. I.e., if 4051 a filesystem does not support sparse files, then a compound with 4052 {SEEK 0 NFS4_CONTENT_HOLE;} would return a result of {SEEK 1 X;} 4053 where 'X' was the size of the file. 4055 SEEK must follow the same rules for stateids as READ_PLUS 4056 (Section 16.10.3). 4058 16.12. Operation 70: WRITE_SAME - WRITE an ADB Multiple Times to a File 4060 16.12.1. ARGUMENT 4062 enum stable_how4 { 4063 UNSTABLE4 = 0, 4064 DATA_SYNC4 = 1, 4065 FILE_SYNC4 = 2 4066 }; 4068 struct app_data_block4 { 4069 offset4 adb_offset; 4070 length4 adb_block_size; 4071 length4 adb_block_count; 4072 length4 adb_reloff_blocknum; 4073 count4 adb_block_num; 4074 length4 adb_reloff_pattern; 4075 opaque adb_pattern<>; 4076 }; 4078 struct WRITE_SAME4args { 4079 /* CURRENT_FH: file */ 4080 stateid4 wsa_stateid; 4081 stable_how4 wsa_stable; 4082 app_data_block4 wsa_adb; 4083 }; 4085 16.12.2. RESULT 4087 struct write_response4 { 4088 stateid4 wr_callback_id<1>; 4089 length4 wr_count; 4090 stable_how4 wr_committed; 4091 verifier4 wr_writeverf; 4092 }; 4093 union WRITE_SAME4res switch (nfsstat4 wsr_status) { 4094 case NFS4_OK: 4095 write_response4 resok4; 4096 default: 4097 void; 4098 }; 4100 16.12.3. DESCRIPTION 4102 The WRITE_SAME operation writes an application data block to the 4103 regular file identified by the current filehandle (see WRITE SAME 4104 (10) in [T10-SBC2]). The target file is specified by the current 4105 filehandle. The data to be written is specified by an 4106 app_data_block4 structure (Section 8.1.1). The client specifies with 4107 the wsa_stable parameter the method of how the data is to be 4108 processed by the server. It is treated like the stable parameter in 4109 the NFSv4.1 WRITE operation (see Section 18.2 of [RFC5661]). 4111 A successful WRITE_SAME will construct a reply for wr_count, 4112 wr_committed, and wr_writeverf as per the NFSv4.1 WRITE operation 4113 results. If wr_callback_id is set, it indicates an asynchronous 4114 reply (see Section 16.12.3.1). 4116 WRITE_SAME has to support all of the errors which are returned by 4117 WRITE plus NFS4ERR_NOTSUPP, i.e., it is an OPTIONAL operation. If 4118 the client supports WRITE_SAME, it MUST support CB_OFFLOAD. 4120 If the server supports ADBs, then it MUST support the WRITE_SAME 4121 operation. The server has no concept of the structure imposed by the 4122 application. It is only when the application writes to a section of 4123 the file does order get imposed. In order to detect corruption even 4124 before the application utilizes the file, the application will want 4125 to initialize a range of ADBs using WRITE_SAME. 4127 When the client invokes the WRITE_SAME operation, it wants to record 4128 the block structure described by the app_data_block4 on to the file. 4130 When the server receives the WRITE_SAME operation, it MUST populate 4131 adb_block_count ADBs in the file starting at adb_offset. The block 4132 size will be given by adb_block_size. The ADBN (if provided) will 4133 start at adb_reloff_blocknum and each block will be monotonically 4134 numbered starting from adb_block_num in the first block. The pattern 4135 (if provided) will be at adb_reloff_pattern of each block and will be 4136 provided in adb_pattern. 4138 The server SHOULD return an asynchronous result if it can determine 4139 the operation will be long running (see Section 16.12.3.1). Once 4140 either the WRITE_SAME finishes synchronously or the server uses 4141 CB_OFFLOAD to inform the client of the asynchronous completion of the 4142 WRITE_SAME, the server MUST return the ADBs to clients as data. 4144 16.12.3.1. Asynchronous Transactions 4146 ADB initialization may lead to server determining to service the 4147 operation asynchronously. If it decides to do so, it sets the 4148 stateid in wr_callback_id to be that of the wsa_stateid. If it does 4149 not set the wr_callback_id, then the result is synchronous. 4151 When the client determines that the reply will be given 4152 asynchronously, it should not assume anything about the contents of 4153 what it wrote until it is informed by the server that the operation 4154 is complete. It can use OFFLOAD_STATUS (Section 16.9) to monitor the 4155 operation and OFFLOAD_CANCEL (Section 16.8) to cancel the operation. 4156 An example of a asynchronous WRITE_SAME is shown in Figure 6. Note 4157 that as with the COPY operation, WRITE_SAME must provide a stateid 4158 for tracking the asynchronous operation. 4160 Client Server 4161 + + 4162 | | 4163 |--- OPEN ---------------------------->| Client opens 4164 |<------------------------------------/| the file 4165 | | 4166 |--- WRITE_SAME ----------------------->| Client initializes 4167 |<------------------------------------/| an ADB 4168 | | 4169 | | 4170 |--- OFFLOAD_STATUS ------------------>| Client may poll 4171 |<------------------------------------/| for status 4172 | | 4173 | . | Multiple OFFLOAD_STATUS 4174 | . | operations may be sent. 4175 | . | 4176 | | 4177 |<-- CB_OFFLOAD -----------------------| Server reports results 4178 |\------------------------------------>| 4179 | | 4180 |--- CLOSE --------------------------->| Client closes 4181 |<------------------------------------/| the file 4182 | | 4183 | | 4185 Figure 6: An asynchronous WRITE_SAME. 4187 When CB_OFFLOAD informs the client of the successful WRITE_SAME, the 4188 write_response4 embedded in the operation will provide the necessary 4189 information that a synchronous WRITE_SAME would have provided. 4191 Regardless of whether the operation is asynchronous or synchronous, 4192 it MUST still support the COMMIT operation semantics as outlined in 4193 Section 18.3 of [RFC5661]. I.e., COMMIT works on one or more WRITE 4194 operations and the WRITE_SAME operation can appear as several WRITE 4195 operations to the server. The client can use locking operations to 4196 control the behavior on the server with respect to long running 4197 asynchronous write operations. 4199 16.12.3.2. Error Handling of a Partially Complete WRITE_SAME 4201 WRITE_SAME will clone adb_block_count copies of the given ADB in 4202 consecutive order in the file starting at adb_offset. An error can 4203 occur after writing the Nth ADB to the file. WRITE_SAME MUST appear 4204 to populate the range of the file as if the client used WRITE to 4205 transfer the instantiated ADBs. I.e., the contents of the range will 4206 be easy for the client to determine in case of a partially complete 4207 WRITE_SAME. 4209 17. NFSv4.2 Callback Operations 4211 17.1. Operation 15: CB_OFFLOAD - Report results of an asynchronous 4212 operation 4214 17.1.1. ARGUMENT 4216 struct write_response4 { 4217 stateid4 wr_callback_id<1>; 4218 length4 wr_count; 4219 stable_how4 wr_committed; 4220 verifier4 wr_writeverf; 4221 }; 4222 union offload_info4 switch (nfsstat4 coa_status) { 4223 case NFS4_OK: 4224 write_response4 coa_resok4; 4225 default: 4226 length4 coa_bytes_copied; 4227 }; 4229 struct CB_OFFLOAD4args { 4230 nfs_fh4 coa_fh; 4231 stateid4 coa_stateid; 4232 offload_info4 coa_offload_info; 4233 }; 4235 17.1.2. RESULT 4237 struct CB_OFFLOAD4res { 4238 nfsstat4 cor_status; 4239 }; 4241 17.1.3. DESCRIPTION 4243 CB_OFFLOAD is used to report to the client the results of an 4244 asynchronous operation, e.g., Server Side Copy or WRITE_SAME. The 4245 coa_fh and coa_stateid identify the transaction and the coa_status 4246 indicates success or failure. The coa_resok4.wr_callback_id MUST NOT 4247 be set. If the transaction failed, then the coa_bytes_copied 4248 contains the number of bytes copied before the failure occurred. The 4249 coa_bytes_copied value indicates the number of bytes copied but not 4250 which specific bytes have been copied. 4252 If the client supports any of the following operations: 4254 COPY: for both intra-server and inter-server asynchronous copies 4256 WRITE_SAME: for ADB initialization 4258 then the client is REQUIRED to support the CB_OFFLOAD operation. 4260 There is a potential race between the reply to the original 4261 transaction on the forechannel and the CB_OFFLOAD callback on the 4262 backchannel. Sections 2.10.6.3 and 20.9.3 of [RFC5661] describe how 4263 to handle this type of issue. 4265 Upon success, the coa_resok4.wr_count presents for each operation: 4267 COPY: the total number of bytes copied 4268 WRITE_SAME: the same information that a synchronous WRITE_SAME would 4269 provide 4271 18. IANA Considerations 4273 The IANA Considerations for Labeled NFS are addressed in [Quigley14]. 4275 19. References 4277 19.1. Normative References 4279 [NFSv42xdr] 4280 Haynes, T., "Network File System (NFS) Version 4 Minor 4281 Version 2 External Data Representation Standard (XDR) 4282 Description", September 2014. 4284 [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform 4285 Resource Identifier (URI): Generic Syntax", STD 66, RFC 4286 3986, January 2005. 4288 [RFC5661] Shepler, S., Eisler, M., and D. Noveck, "Network File 4289 System (NFS) Version 4 Minor Version 1 Protocol", RFC 4290 5661, January 2010. 4292 [RFC5664] Halevy, B., Welch, B., and J. Zelenka, "Object-Based 4293 Parallel NFS (pNFS) Operations", RFC 5664, January 2010. 4295 [posix_fadvise] 4296 The Open Group, "Section 'posix_fadvise()' of System 4297 Interfaces of The Open Group Base Specifications Issue 6, 4298 IEEE Std 1003.1, 2004 Edition", 2004. 4300 [posix_fallocate] 4301 The Open Group, "Section 'posix_fallocate()' of System 4302 Interfaces of The Open Group Base Specifications Issue 6, 4303 IEEE Std 1003.1, 2004 Edition", 2004. 4305 [rpcsec_gssv3] 4306 Adamson, W. and N. Williams, "Remote Procedure Call (RPC) 4307 Security Version 3", July 2014. 4309 19.2. Informative References 4311 [Ashdown08] 4312 Ashdown, L., "Chapter 15, Validating Database Files and 4313 Backups, of Oracle Database Backup and Recovery User's 4314 Guide 11g Release 1 (11.1)", August 2008. 4316 [BL73] Bell, D. and L. LaPadula, "Secure Computer Systems: 4317 Mathematical Foundations and Model", Technical Report 4318 M74-244, The MITRE Corporation, Bedford, MA, May 1973. 4320 [Baira08] Bairavasundaram, L., Goodson, G., Schroeder, B., Arpaci- 4321 Dusseau, A., and R. Arpaci-Dusseau, "An Analysis of Data 4322 Corruption in the Storage Stack", Proceedings of the 6th 4323 USENIX Symposium on File and Storage Technologies (FAST 4324 '08) , 2008. 4326 [I-D.ietf-nfsv4-rfc3530bis] 4327 Haynes, T. and D. Noveck, "Network File System (NFS) 4328 version 4 Protocol", draft-ietf-nfsv4-rfc3530bis-33 (Work 4329 In Progress), April 2014. 4331 [IESG08] ISEG, "IESG Processing of RFC Errata for the IETF Stream", 4332 2008. 4334 [McDougall07] 4335 McDougall, R. and J. Mauro, "Section 11.4.3, Detecting 4336 Memory Corruption of Solaris Internals", 2007. 4338 [Quigley14] 4339 Quigley, D., Lu, J., and T. Haynes, "Registry 4340 Specification for Mandatory Access Control (MAC) Security 4341 Label Formats", draft-ietf-nfsv4-lfs-registry-01 (work in 4342 progress), September 2014. 4344 [RFC1108] Kent, S., "Security Options for the Internet Protocol", 4345 RFC 1108, November 1991. 4347 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 4348 Requirement Levels", March 1997. 4350 [RFC2401] Kent, S. and R. Atkinson, "Security Architecture for the 4351 Internet Protocol", RFC 2401, November 1998. 4353 [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., 4354 Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext 4355 Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. 4357 [RFC4506] Eisler, M., "XDR: External Data Representation Standard", 4358 RFC 4506, May 2006. 4360 [RFC5663] Black, D., Fridella, S., and J. Glasgow, "Parallel NFS 4361 (pNFS) Block/Volume Layout", RFC 5663, January 2010. 4363 [RFC7204] Haynes, T., "Requirements for Labeled NFS", RFC 7204, 4364 April 2014. 4366 [RFC959] Postel, J. and J. Reynolds, "File Transfer Protocol", STD 4367 9, RFC 959, October 1985. 4369 [Strohm11] 4370 Strohm, R., "Chapter 2, Data Blocks, Extents, and 4371 Segments, of Oracle Database Concepts 11g Release 1 4372 (11.1)", January 2011. 4374 [T10-SBC2] 4375 Elliott, R., Ed., "ANSI INCITS 405-2005, Information 4376 Technology - SCSI Block Commands - 2 (SBC-2)", November 4377 2004. 4379 Appendix A. Acknowledgments 4381 Tom Haynes would like to thank NetApp, Inc. for its funding of his 4382 time on this project. 4384 For the pNFS Access Permissions Check, the original draft was by 4385 Sorin Faibish, David Black, Mike Eisler, and Jason Glasgow. The work 4386 was influenced by discussions with Benny Halevy and Bruce Fields. A 4387 review was done by Tom Haynes. 4389 For the Sharing change attribute implementation details with NFSv4 4390 clients, the original draft was by Trond Myklebust. 4392 For the NFS Server Side Copy, the original draft was by James 4393 Lentini, Mike Eisler, Deepak Kenchammana, Anshul Madan, and Rahul 4394 Iyer. Tom Talpey co-authored an unpublished version of that 4395 document. It was also was reviewed by a number of individuals: 4396 Pranoop Erasani, Tom Haynes, Arthur Lent, Trond Myklebust, Dave 4397 Noveck, Theresa Lingutla-Raj, Manjunath Shankararao, Satyam Vaghani, 4398 and Nico Williams. Anna Schumaker's early prototyping experience 4399 helped us avoid some traps. 4401 For the NFS space reservation operations, the original draft was by 4402 Mike Eisler, James Lentini, Manjunath Shankararao, and Rahul Iyer. 4404 For the sparse file support, the original draft was by Dean 4405 Hildebrand and Marc Eshel. Valuable input and advice was received 4406 from Sorin Faibish, Bruce Fields, Benny Halevy, Trond Myklebust, and 4407 Richard Scheffenegger. 4409 For the Application IO Hints, the original draft was by Dean 4410 Hildebrand, Mike Eisler, Trond Myklebust, and Sam Falkner. Some 4411 early reviewers included Benny Halevy and Pranoop Erasani. 4413 For Labeled NFS, the original draft was by David Quigley, James 4414 Morris, Jarret Lu, and Tom Haynes. Peter Staubach, Trond Myklebust, 4415 Stephen Smalley, Sorin Faibish, Nico Williams, and David Black also 4416 contributed in the final push to get this accepted. 4418 Christoph Hellwig was very helpful in getting the WRITE_SAME 4419 semantics to model more of what T10 was doing for WRITE SAME (10) 4420 [T10-SBC2]. And he led the push to get space reservations to more 4421 closely model the posix_fallocate. 4423 Andy Adamson picked up the RPCSEC_GSSv3 work, which enabled both 4424 Labeled NFS and Server Side Copy to be present more secure options. 4426 Christoph Hellwig provided the update to GETDEVICELIST. 4428 During the review process, Talia Reyes-Ortiz helped the sessions run 4429 smoothly. While many people contributed here and there, the core 4430 reviewers were Andy Adamson, Pranoop Erasani, Bruce Fields, Chuck 4431 Lever, Trond Myklebust, David Noveck, Peter Staubach, and Mike 4432 Kupfer. 4434 Appendix B. RFC Editor Notes 4436 [RFC Editor: please remove this section prior to publishing this 4437 document as an RFC] 4439 [RFC Editor: prior to publishing this document as an RFC, please 4440 replace all occurrences of NFSv42xdr with RFCxxxx where xxxx is the 4441 RFC number of the companion XDR document] 4443 Author's Address 4445 Thomas Haynes 4446 Primary Data, Inc. 4447 4300 El Camino Real Ste 100 4448 Los Altos, CA 94022 4449 USA 4451 Phone: +1 408 215 1519 4452 Email: thomas.haynes@primarydata.com