idnits 2.17.1 draft-ietf-nfsv4-scsi-layout-01.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 : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (July 25, 2015) is 3192 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) -- Possible downref: Non-RFC (?) normative reference: ref. 'LEGAL' ** Obsolete normative reference: RFC 5661 (Obsoleted by RFC 8881) -- Possible downref: Non-RFC (?) normative reference: ref. 'SAM-4' -- Possible downref: Non-RFC (?) normative reference: ref. 'SBC3' -- Possible downref: Non-RFC (?) normative reference: ref. 'SPC3' Summary: 1 error (**), 0 flaws (~~), 1 warning (==), 6 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 NFSv4 C. Hellwig 3 Internet-Draft July 25, 2015 4 Intended status: Standards Track 5 Expires: January 26, 2016 7 Parallel NFS (pNFS) SCSI Layout 8 draft-ietf-nfsv4-scsi-layout-01.txt 10 Abstract 12 The Parallel Network File System (pNFS) allows a separation between 13 the metadata (onto a metadata server) and data (onto a storage 14 device) for a file. The SCSI Layout Type is defined in this document 15 as an extension to pNFS to allow the use SCSI based block storage 16 devices. 18 Status of this Memo 20 This Internet-Draft is submitted in full conformance with the 21 provisions of BCP 78 and BCP 79. 23 Internet-Drafts are working documents of the Internet Engineering 24 Task Force (IETF). Note that other groups may also distribute 25 working documents as Internet-Drafts. The list of current Internet- 26 Drafts is at http://datatracker.ietf.org/drafts/current/. 28 Internet-Drafts are draft documents valid for a maximum of six months 29 and may be updated, replaced, or obsoleted by other documents at any 30 time. It is inappropriate to use Internet-Drafts as reference 31 material or to cite them other than as "work in progress." 33 This Internet-Draft will expire on January 26, 2016. 35 Copyright Notice 37 Copyright (c) 2015 IETF Trust and the persons identified as the 38 document authors. All rights reserved. 40 This document is subject to BCP 78 and the IETF Trust's Legal 41 Provisions Relating to IETF Documents 42 (http://trustee.ietf.org/license-info) in effect on the date of 43 publication of this document. Please review these documents 44 carefully, as they describe your rights and restrictions with respect 45 to this document. Code Components extracted from this document must 46 include Simplified BSD License text as described in Section 4.e of 47 the Trust Legal Provisions and are provided without warranty as 48 described in the Simplified BSD License. 50 Table of Contents 52 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 3 53 1.1. Conventions Used in This Document . . . . . . . . . . . . 4 54 1.2. General Definitions . . . . . . . . . . . . . . . . . . . 4 55 1.3. Code Components Licensing Notice . . . . . . . . . . . . . 4 56 1.4. XDR Description . . . . . . . . . . . . . . . . . . . . . 4 57 2. Block Layout Description . . . . . . . . . . . . . . . . . . . 6 58 2.1. Background and Architecture . . . . . . . . . . . . . . . 6 59 2.2. layouttype4 . . . . . . . . . . . . . . . . . . . . . . . 7 60 2.3. GETDEVICEINFO . . . . . . . . . . . . . . . . . . . . . . 8 61 2.3.1. Volume Identification . . . . . . . . . . . . . . . . 8 62 2.3.2. Volume Topology . . . . . . . . . . . . . . . . . . . 9 63 2.4. Data Structures: Extents and Extent Lists . . . . . . . . 12 64 2.4.1. Layout Requests and Extent Lists . . . . . . . . . . . 14 65 2.4.2. Layout Commits . . . . . . . . . . . . . . . . . . . . 15 66 2.4.3. Layout Returns . . . . . . . . . . . . . . . . . . . . 16 67 2.4.4. Client Copy-on-Write Processing . . . . . . . . . . . 16 68 2.4.5. Extents are Permissions . . . . . . . . . . . . . . . 17 69 2.4.6. End-of-file Processing . . . . . . . . . . . . . . . . 19 70 2.4.7. Layout Hints . . . . . . . . . . . . . . . . . . . . . 19 71 2.4.8. Client Fencing . . . . . . . . . . . . . . . . . . . . 19 72 2.5. Crash Recovery Issues . . . . . . . . . . . . . . . . . . 21 73 2.6. Recalling Resources: CB_RECALL_ANY . . . . . . . . . . . . 22 74 2.7. Transient and Permanent Errors . . . . . . . . . . . . . . 22 75 2.8. Volatile write caches . . . . . . . . . . . . . . . . . . 23 76 3. Security Considerations . . . . . . . . . . . . . . . . . . . 23 77 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25 78 5. Normative References . . . . . . . . . . . . . . . . . . . . . 25 79 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 26 80 Appendix B. RFC Editor Notes . . . . . . . . . . . . . . . . . . 26 81 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 26 83 1. Introduction 85 Figure 1 shows the overall architecture of a Parallel NFS (pNFS) 86 system: 88 +-----------+ 89 |+-----------+ +-----------+ 90 ||+-----------+ | | 91 ||| | NFSv4.1 + pNFS | | 92 +|| Clients |<------------------------------>| Server | 93 +| | | | 94 +-----------+ | | 95 ||| +-----------+ 96 ||| | 97 ||| | 98 ||| Storage +-----------+ | 99 ||| Protocol |+-----------+ | 100 ||+----------------||+-----------+ Control | 101 |+-----------------||| | Protocol| 102 +------------------+|| Storage |------------+ 103 +| Systems | 104 +-----------+ 106 Figure 1 108 The overall approach is that pNFS-enhanced clients obtain sufficient 109 information from the server to enable them to access the underlying 110 storage (on the storage systems) directly. See the pNFS portion of 111 [RFC5661] for more details. This document is concerned with access 112 from pNFS clients to storage devices over block storage protocols 113 based on the the SCSI Architecture Model ([SAM-4]), e.g., Fibre 114 Channel Protocol (FCP) for Fibre Channel, Internet SCSI (iSCSI) or 115 Serial Attached SCSI (SAS). pNFS SCSI layout requires block based 116 SCSI command sets, for example SCSI Block Commands ([SBC3]). While 117 SCSI command set for non-block based access exist these are not 118 supported by the SCSI layout type, and all future references to SCSI 119 storage devices will imply a block based SCSI command set. 121 The Server to Storage System protocol, called the "Control Protocol", 122 is not of concern for interoperability, although it will typically be 123 the same SCSI based storage protocol. 125 This document is based on and updates [RFC5663] to provide a better 126 pNFS layout protocol for SCSI based storage devices, and functionally 127 obsoletes [RFC6688] by providing mandatory disk access protection as 128 part of the protocol. 130 1.1. Conventions Used in This Document 132 The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", 133 "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this 134 document are to be interpreted as described in [RFC2119]. 136 1.2. General Definitions 138 The following definitions are provided for the purpose of providing 139 an appropriate context for the reader. 141 Byte This document defines a byte as an octet, i.e., a datum exactly 142 8 bits in length. 144 Client The "client" is the entity that accesses the NFS server's 145 resources. The client may be an application that contains the 146 logic to access the NFS server directly. The client may also be 147 the traditional operating system client that provides remote file 148 system services for a set of applications. 150 Server The "server" is the entity responsible for coordinating 151 client access to a set of file systems and is identified by a 152 server owner. 154 1.3. Code Components Licensing Notice 156 The external data representation (XDR) description and scripts for 157 extracting the XDR description are Code Components as described in 158 Section 4 of "Legal Provisions Relating to IETF Documents" [LEGAL]. 159 These Code Components are licensed according to the terms of Section 160 4 of "Legal Provisions Relating to IETF Documents". 162 1.4. XDR Description 164 This document contains the XDR [RFC4506] description of the NFSv4.1 165 SCSI layout protocol. The XDR description is embedded in this 166 document in a way that makes it simple for the reader to extract into 167 a ready-to-compile form. The reader can feed this document into the 168 following shell script to produce the machine readable XDR 169 description of the NFSv4.1 SCSI layout: 171 #!/bin/sh 172 grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??' 174 That is, if the above script is stored in a file called "extract.sh", 175 and this document is in a file called "spec.txt", then the reader can 176 do: 178 sh extract.sh < spec.txt > scsi_prot.x 180 The effect of the script is to remove leading white space from each 181 line, plus a sentinel sequence of "///". 183 The embedded XDR file header follows. Subsequent XDR descriptions, 184 with the sentinel sequence are embedded throughout the document. 186 Note that the XDR code contained in this document depends on types 187 from the NFSv4.1 nfs4_prot.x file [RFC5662]. This includes both nfs 188 types that end with a 4, such as offset4, length4, etc., as well as 189 more generic types such as uint32_t and uint64_t. 191 /// /* 192 /// * This code was derived from RFCTBD10 193 /// * Please reproduce this note if possible. 194 /// */ 195 /// /* 196 /// * Copyright (c) 2010,2015 IETF Trust and the persons identified 197 /// * as the document authors. All rights reserved. 198 /// * 199 /// * Redistribution and use in source and binary forms, with 200 /// * or without modification, are permitted provided that the 201 /// * following conditions are met: 202 /// * 203 /// * - Redistributions of source code must retain the above 204 /// * copyright notice, this list of conditions and the 205 /// * following disclaimer. 206 /// * 207 /// * - Redistributions in binary form must reproduce the above 208 /// * copyright notice, this list of conditions and the 209 /// * following disclaimer in the documentation and/or other 210 /// * materials provided with the distribution. 211 /// * 212 /// * - Neither the name of Internet Society, IETF or IETF 213 /// * Trust, nor the names of specific contributors, may be 214 /// * used to endorse or promote products derived from this 215 /// * software without specific prior written permission. 216 /// * 217 /// * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS 218 /// * AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED 219 /// * WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE 220 /// * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 221 /// * FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO 222 /// * EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE 223 /// * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, 224 /// * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 225 /// * NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR 226 /// * SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS 227 /// * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF 228 /// * LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, 229 /// * OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING 230 /// * IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF 231 /// * ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 232 /// */ 233 /// 234 /// /* 235 /// * nfs4_scsi_layout_prot.x 236 /// */ 237 /// 238 /// %#include "nfsv41.h" 239 /// 241 2. Block Layout Description 243 2.1. Background and Architecture 245 The fundamental storage abstraction supported by SCSI storage devices 246 is a Logical Unit (LU) consisting of a sequential series of fixed- 247 size blocks. This can be thought of as a logical disk; it may be 248 realized by the storage system as a physical disk, a portion of a 249 physical disk, or something more complex (e.g., concatenation, 250 striping, RAID, and combinations thereof) involving multiple physical 251 disks or portions thereof. 253 A pNFS layout for this SCSI class of storage is responsible for 254 mapping from an NFS file (or portion of a file) to the blocks of 255 storage volumes that contain the file. The blocks are expressed as 256 extents with 64-bit offsets and lengths using the existing NFSv4 257 offset4 and length4 types. Clients must be able to perform I/O to 258 the block extents without affecting additional areas of storage 259 (especially important for writes); therefore, extents MUST be aligned 260 to 512-byte boundaries, and writable extents MUST be aligned to the 261 block size used by the NFSv4 server in managing the actual file 262 system (4 kilobytes and 8 kilobytes are common block sizes). This 263 block size is available as the NFSv4.1 layout_blksize attribute. 264 [RFC5661]. Readable extents SHOULD be aligned to the block size used 265 by the NFSv4 server, but in order to support legacy file systems with 266 fragments, alignment to 512-byte boundaries is acceptable. 268 The pNFS operation for requesting a layout (LAYOUTGET) includes the 269 "layoutiomode4 loga_iomode" argument, which indicates whether the 270 requested layout is for read-only use or read-write use. A read-only 271 layout may contain holes that are read as zero, whereas a read-write 272 layout will contain allocated, but un-initialized storage in those 273 holes (read as zero, can be written by client). This document also 274 supports client participation in copy-on-write (e.g., for file 275 systems with snapshots) by providing both read-only and un- 276 initialized storage for the same range in a layout. Reads are 277 initially performed on the read-only storage, with writes going to 278 the un-initialized storage. After the first write that initializes 279 the un-initialized storage, all reads are performed to that now- 280 initialized writable storage, and the corresponding read-only storage 281 is no longer used. 283 The SCSI layout solution expands the security responsibilities of the 284 pNFS clients, and there are a number of environments where the 285 mandatory to implement security properties for NFS cannot be 286 satisfied. The additional security responsibilities of the client 287 follow, and a full discussion is present im Section 3, "Security 288 Considerations". 290 o Typically, SCSI storage devices provide access control mechanisms 291 (e.g., Logical Unit Number (LUN) mapping and/or masking), which 292 operate at the granularity of individual hosts, not individual 293 blocks. For this reason, block-based protection must be provided 294 by the client software. 296 o Similarly, SCSI storage devices typically are not able to validate 297 NFS locks that apply to file regions. For instance, if a file is 298 covered by a mandatory read-only lock, the server can ensure that 299 only readable layouts for the file are granted to pNFS clients. 300 However, it is up to each pNFS client to ensure that the readable 301 layout is used only to service read requests, and not to allow 302 writes to the existing parts of the file. 304 Since SCSI storage devices are generally not capable of enforcing 305 such file-based security, in environments where pNFS clients cannot 306 be trusted to enforce such policies, pNFS SCSI layouts SHOULD NOT be 307 used. 309 2.2. layouttype4 311 The layout4 type defined in [RFC5662] is extended with a new value as 312 follows: 314 enum layouttype4 { 315 LAYOUT4_NFSV4_1_FILES = 1, 316 LAYOUT4_OSD2_OBJECTS = 2, 317 LAYOUT4_BLOCK_VOLUME = 3, 318 LAYOUT4_SCSI = 0x80000005 319 [[RFC Editor: please modify the LAYOUT4_SCSI 320 to be the layouttype assigned by IANA]] 321 }; 323 This document defines structure associated with the layouttype4 value 324 LAYOUT4_SCSI. [RFC5661] specifies the loc_body structure as an XDR 325 type "opaque". The opaque layout is uninterpreted by the generic 326 pNFS client layers, but obviously must be interpreted by the Layout 327 Type implementation. 329 2.3. GETDEVICEINFO 331 2.3.1. Volume Identification 333 SCSI targets implementing [SPC3] export unique LU names for each LU 334 through the Device Identification VPD page, which can be obtained 335 using the INQUIRY command. This document uses a subset of this 336 information to identify LUs backing pNFS SCSI layouts. It is similar 337 to the "Identification Descriptor Target Descriptor" specified in 338 [SPC3], but limits the allowed values to those that uniquely identify 339 a LU. Device Identification VPD page descriptors used to identify 340 LUs for use with pNFS SCSI layouts must adhere to the following 341 restrictions: 343 1. The "ASSOCIATION" must be set to 0 (The DESIGNATOR field is 344 associated with the addressed logical unit). 346 2. The "DESIGNATOR TYPE" must be set to one of three values 347 explicitly listed in the "pnfs_scsi_designator_type" 348 enumerations. 350 The "CODE SET" VPD page field is stored in the "sbv_code_set" field 351 of the "pnfs_scsi_base_volume_info4" structure, the "DESIGNATOR TYPE" 352 is stored in "sbv_designator_type", and the DESIGNATOR is stored in 353 "sbv_designator". Due to the use of a XDR array the "DESIGNATOR 354 LENGTH" field does not need to be set separately. Only certain 355 combinations of "sbv_code_set" and "sbv_designator_type" are valid, 356 please refer to [SPC3] for details, and note that ASCII may be used 357 as the code set for UTF-8 text that contains only ASCII characters. 358 Note that a Device Identification VPD page MAY contain multiple 359 descriptors with the same association, code set and designator type. 360 NFS clients thus MUST iterate the descriptors until a match for 361 "sbv_code_set", "sbv_designator_type" and "sbv_designator" is found, 362 or until the end of VPD page. 364 Storage devices such as storage arrays can have multiple physical 365 network ports that need not be connected to a common network, 366 resulting in a pNFS client having simultaneous multipath access to 367 the same storage volumes via different ports on different networks. 368 Selection of one or multiple ports to access the storage device is 369 left up to the client. 371 Additionally the server returns a Persistent Reservation key in the 372 "sbv_pr_key" field. See Section 2.4.8 for more details on the use of 373 Persistent Reservations. 375 2.3.2. Volume Topology 377 The pNFS SCSI layout volume topology is expressed as an arbitrary 378 combination of base volume types enumerated in the following data 379 structures. The individual components of the topology are contained 380 in an array and components may refer to other components by using 381 array indices. 383 /// enum pnfs_scsi_volume_type4 { 384 /// PNFS_SCSI_VOLUME_BASE = 0, /* volume maps to a single 385 /// LU */ 386 /// PNFS_SCSI_VOLUME_SLICE = 1, /* volume is a slice of 387 /// another volume */ 388 /// PNFS_SCSI_VOLUME_CONCAT = 2, /* volume is a 389 /// concatenation of 390 /// multiple volumes */ 391 /// PNFS_SCSI_VOLUME_STRIPE = 3 /* volume is striped across 392 /// multiple volumes */ 393 /// }; 394 /// 396 /// /* 397 /// * Code sets from SPC-3. 398 /// */ 399 /// enum pnfs_scsi_code_set { 400 /// PS_CODE_SET_BINARY = 1, 401 /// PS_CODE_SET_ASCII = 2, 402 /// PS_CODE_SET_UTF8 = 3 403 /// }; 404 /// 405 /// /* 406 /// * Designator types from taken from SPC-3. 407 /// * 408 /// * Other values are allocated in SPC-3, but not mandatory to 409 /// * implement or aren't Logical Unit names. 410 /// */ 411 /// enum pnfs_scsi_designator_type { 412 /// PS_DESIGNATOR_EUI64 = 2, 413 /// PS_DESIGNATOR_NAA = 3, 414 /// PS_DESIGNATOR_NAME = 8 415 /// }; 416 /// 417 /// /* 418 /// * Logical Unit name + reservation key. 419 /// */ 420 /// struct pnfs_scsi_base_volume_info4 { 421 /// pnfs_scsi_code_set sbv_code_set; 422 /// pnfs_scsi_designator_type sbv_designator_type; 423 /// opaque sbv_designator<>; 424 /// uint32_t sbv_pr_key; 425 /// }; 426 /// 428 /// 429 /// struct pnfs_scsi_slice_volume_info4 { 430 /// offset4 ssv_start; /* offset of the start of the 431 /// slice in bytes */ 432 /// length4 ssv_length; /* length of slice in bytes */ 433 /// uint32_t ssv_volume; /* array index of sliced 434 /// volume */ 435 /// }; 437 /// 438 /// struct pnfs_scsi_concat_volume_info4 { 439 /// uint32_t scv_volumes<>; /* array indices of volumes 440 /// which are concatenated */ 441 /// }; 443 /// 444 /// struct pnfs_scsi_stripe_volume_info4 { 445 /// length4 ssv_stripe_unit; /* size of stripe in bytes */ 446 /// uint32_t ssv_volumes<>; /* array indices of volumes 447 /// which are striped across -- 448 /// MUST be same size */ 449 /// }; 451 /// 452 /// union pnfs_scsi_volume4 switch (pnfs_scsi_volume_type4 type) { 453 /// case PNFS_SCSI_VOLUME_BASE: 454 /// pnfs_scsi_base_volume_info4 sv_simple_info; 455 /// case PNFS_SCSI_VOLUME_SLICE: 456 /// pnfs_scsi_slice_volume_info4 sv_slice_info; 457 /// case PNFS_SCSI_VOLUME_CONCAT: 458 /// pnfs_scsi_concat_volume_info4 sv_concat_info; 459 /// case PNFS_SCSI_VOLUME_STRIPE: 460 /// pnfs_scsi_stripe_volume_info4 sv_stripe_info; 461 /// }; 462 /// 464 /// /* SCSI layout specific type for da_addr_body */ 465 /// struct pnfs_scsi_deviceaddr4 { 466 /// pnfs_scsi_volume4 sda_volumes<>; /* array of volumes */ 467 /// }; 468 /// 470 The "pnfs_scsi_deviceaddr4" data structure is a structure that allows 471 arbitrarily complex nested volume structures to be encoded. The 472 types of aggregations that are allowed are stripes, concatenations, 473 and slices. Note that the volume topology expressed in the 474 pnfs_scsi_deviceaddr4 data structure will always resolve to a set of 475 pnfs_scsi_volume_type4 PNFS_SCSI_VOLUME_BASE. The array of volumes 476 is ordered such that the root of the volume hierarchy is the last 477 element of the array. Concat, slice, and stripe volumes MUST refer 478 to volumes defined by lower indexed elements of the array. 480 The "pnfs_scsi_device_addr4" data structure is returned by the server 481 as the storage-protocol-specific opaque field da_addr_body in the 482 "device_addr4" structure by a successful GETDEVICEINFO operation 483 [RFC5661]. 485 As noted above, all device_addr4 structures eventually resolve to a 486 set of volumes of type PNFS_SCSI_VOLUME_BASE. Complicated volume 487 hierarchies may be composed of dozens of volumes each with several 488 signature components; thus, the device address may require several 489 kilobytes. The client SHOULD be prepared to allocate a large buffer 490 to contain the result. In the case of the server returning 491 NFS4ERR_TOOSMALL, the client SHOULD allocate a buffer of at least 492 gdir_mincount_bytes to contain the expected result and retry the 493 GETDEVICEINFO request. 495 2.4. Data Structures: Extents and Extent Lists 497 A pNFS SCSI layout is a list of extents within a flat array of data 498 blocks in a logical volume. The details of the volume topology can 499 be determined by using the GETDEVICEINFO operation. The SCSI layout 500 describes the individual block extents on the volume that make up the 501 file. The offsets and length contained in an extent are specified in 502 units of bytes. 504 /// enum pnfs_scsi_extent_state4 { 505 /// PNFS_SCSI_READ_WRITE_DATA = 0, /* the data located by this 506 /// extent is valid 507 /// for reading and writing. */ 508 /// PNFS_SCSI_READ_DATA = 1, /* the data located by this 509 /// extent is valid for reading 510 /// only; it may not be 511 /// written. */ 512 /// PNFS_SCSI_INVALID_DATA = 2, /* the location is valid; the 513 /// data is invalid. It is a 514 /// newly (pre-) allocated 515 /// extent. There is physical 516 /// space on the volume. */ 517 /// PNFS_SCSI_NONE_DATA = 3 /* the location is invalid. 518 /// It is a hole in the file. 519 /// There is no physical space 520 /// on the volume. */ 521 /// }; 523 /// 524 /// struct pnfs_scsi_extent4 { 525 /// deviceid4 se_vol_id; /* id of logical volume on 526 /// which extent of file is 527 /// stored. */ 528 /// offset4 se_file_offset; /* starting byte offset 529 /// in the file */ 530 /// length4 se_length; /* size in bytes of the 531 /// extent */ 532 /// offset4 se_storage_offset; /* starting byte offset 533 /// in the volume */ 534 /// pnfs_scsi_extent_state4 se_state; 535 /// /* state of this extent */ 536 /// }; 538 /// 539 /// /* SCSI layout specific type for loc_body */ 540 /// struct pnfs_scsi_layout4 { 541 /// pnfs_scsi_extent4 sl_extents<>; 542 /// /* extents which make up this 543 /// layout. */ 544 /// }; 545 /// 547 The SCSI layout consists of a list of extents that map the logical 548 regions of the file to physical locations on a volume. The 549 "se_storage_offset" field within each extent identifies a location on 550 the logical volume specified by the "se_vol_id" field in the extent. 551 The se_vol_id itself is shorthand for the whole topology of the 552 logical volume on which the file is stored. The client is 553 responsible for translating this logical offset into an offset on the 554 appropriate underlying SCSI LU. In most cases, all extents in a 555 layout will reside on the same volume and thus have the same 556 se_vol_id. In the case of copy-on-write file systems, the 557 PNFS_SCSI_READ_DATA extents may have a different se_vol_id from the 558 writable extents. 560 Each extent maps a logical region of the file onto a portion of the 561 specified LU. The se_file_offset, se_length, and se_state fields for 562 an extent returned from the server are valid for all extents. In 563 contrast, the interpretation of the se_storage_offset field depends 564 on the value of se_state as follows (in increasing order): 566 PNFS_SCSI_READ_WRITE_DATA means that se_storage_offset is valid, and 567 points to valid/initialized data that can be read and written. 569 PNFS_SCSI_READ_DATA means that se_storage_offset is valid andpoints 570 to valid/initialized data that can only be read. Write operations 571 are prohibited; the client may need to request a read-write 572 layout. 574 PNFS_SCSI_INVALID_DATA means that se_storage_offset is valid, but 575 points to invalid un-initialized data. This data must not be 576 physically read from the disk until it has been initialized. A 577 read request for a PNFS_SCSI_INVALID_DATA extent must fill the 578 user buffer with zeros, unless the extent is covered by a 579 PNFS_SCSI_READ_DATA extent of a copy-on-write file system. Write 580 requests must write whole server-sized blocks to the disk; bytes 581 not initialized by the user must be set to zero. Any write to 582 storage in a PNFS_SCSI_INVALID_DATA extent changes the written 583 portion of the extent to PNFS_SCSI_READ_WRITE_DATA; the pNFS 584 client is responsible for reporting this change via LAYOUTCOMMIT. 586 PNFS_SCSI_NONE_DATA means that se_storage_offset is not valid, and 587 this extent may not be used to satisfy write requests. Read 588 requests may be satisfied by zero-filling as for 589 PNFS_SCSI_INVALID_DATA. PNFS_SCSI_NONE_DATA extents may be 590 returned by requests for readable extents; they are never returned 591 if the request was for a writable extent. 593 An extent list contains all relevant extents in increasing order of 594 the se_file_offset of each extent; any ties are broken by increasing 595 order of the extent state (se_state). 597 2.4.1. Layout Requests and Extent Lists 599 Each request for a layout specifies at least three parameters: file 600 offset, desired size, and minimum size. If the status of a request 601 indicates success, the extent list returned must meet the following 602 criteria: 604 o A request for a readable (but not writable) layout returns only 605 PNFS_SCSI_READ_DATA or PNFS_SCSI_NONE_DATA extents (but not 606 PNFS_SCSI_INVALID_DATA or PNFS_SCSI_READ_WRITE_DATA extents). 608 o A request for a writable layout returns PNFS_SCSI_READ_WRITE_DATA 609 or PNFS_SCSI_INVALID_DATA extents (but not PNFS_SCSI_NONE_DATA 610 extents). It may also return PNFS_SCSI_READ_DATA extents only 611 when the offset ranges in those extents are also covered by 612 PNFS_SCSI_INVALID_DATA extents to permit writes. 614 o The first extent in the list MUST contain the requested starting 615 offset. 617 o The total size of extents within the requested range MUST cover at 618 least the minimum size. One exception is allowed: the total size 619 MAY be smaller if only readable extents were requested and EOF is 620 encountered. 622 o Extents in the extent list MUST be logically contiguous for a 623 read-only layout. For a read-write layout, the set of writable 624 extents (i.e., excluding PNFS_SCSI_READ_DATA extents) MUST be 625 logically contiguous. Every PNFS_SCSI_READ_DATA extent in a read- 626 write layout MUST be covered by one or more PNFS_SCSI_INVALID_DATA 627 extents. This overlap of PNFS_SCSI_READ_DATA and 628 PNFS_SCSI_INVALID_DATA extents is the only permitted extent 629 overlap. 631 o Extents MUST be ordered in the list by starting offset, with 632 PNFS_SCSI_READ_DATA extents preceding PNFS_SCSI_INVALID_DATA 633 extents in the case of equal se_file_offsets. 635 If the minimum requested size, loga_minlength, is zero, this is an 636 indication to the metadata server that the client desires any layout 637 at offset loga_offset or less that the metadata server has "readily 638 available". Readily is subjective, and depends on the layout type 639 and the pNFS server implementation. For SCSI layout servers, readily 640 available SHOULD be interpreted such that readable layouts are always 641 available, even if some extents are in the PNFS_SCSI_NONE_DATA state. 642 When processing requests for writable layouts, a layout is readily 643 available if extents can be returned in the PNFS_SCSI_READ_WRITE_DATA 644 state. 646 2.4.2. Layout Commits 648 /// 649 /// /* SCSI layout specific type for lou_body */ 650 /// 651 /// struct pnfs_scsi_range4 { 652 /// offset4 sr_file_offset; /* starting byte offset 653 /// in the file */ 654 /// length4 sr_length; /* size in bytes of the 655 /// }; 656 /// 657 /// struct pnfs_scsi_layoutupdate4 { 658 /// pnfs_scsi_range4 slu_commit_list<>; 659 /// /* list of extents which 660 /// * now contain valid data. 661 /// */ 662 /// }; 664 The "pnfs_scsi_layoutupdate4" structure is used by the client as the 665 SCSI layout specific argument in a LAYOUTCOMMIT operation. The 666 "slu_commit_list" field is a list covering regions of the file layout 667 that were previously in the PNFS_SCSI_INVALID_DATA state, but have 668 been written by the client and should now be considered in the 669 PNFS_SCSI_READ_WRITE_DATA state. The extents in the commit list MUST 670 be disjoint and MUST be sorted by sr_file_offset. Implementors 671 should be aware that a server may be unable to commit regions at a 672 granularity smaller than a file-system block (typically 4 KB or 8 673 KB). As noted above, the block-size that the server uses is 674 available as an NFSv4 attribute, and any extents included in the 675 "slu_commit_list" MUST be aligned to this granularity and have a size 676 that is a multiple of this granularity. If the client believes that 677 its actions have moved the end-of-file into the middle of a block 678 being committed, the client MUST write zeroes from the end-of-file to 679 the end of that block before committing the block. Failure to do so 680 may result in junk (un-initialized data) appearing in that area if 681 the file is subsequently extended by moving the end-of-file. 683 2.4.3. Layout Returns 685 The LAYOUTRETURN operation is done without any SCSI layout specific 686 data. When the LAYOUTRETURN operation specifies a 687 LAYOUTRETURN4_FILE_return type, then the layoutreturn_file4 data 688 structure specifies the region of the file layout that is no longer 689 needed by the client. The opaque "lrf_body" field of the 690 "layoutreturn_file4" data structure MUST have length zero. A 691 LAYOUTRETURN operation represents an explicit release of resources by 692 the client, usually done for the purpose of avoiding unnecessary 693 CB_LAYOUTRECALL operations in the future. The client may return 694 disjoint regions of the file by using multiple LAYOUTRETURN 695 operations within a single COMPOUND operation. 697 Note that the SCSI layout supports unilateral layout revocation. 698 When a layout is unilaterally revoked by the server, usually due to 699 the client's lease time expiring, or a delegation being recalled, or 700 the client failing to return a layout in a timely manner, it is 701 important for the sake of correctness that any in- flight I/Os that 702 the client issued before the layout was revoked are rejected at the 703 storage. For the SCSI protocol, this is possible by fencing a client 704 with an expired layout timer from the physical storage. Note, 705 however, that the granularity of this operation can only be at the 706 host/LU level. Thus, if one of a client's layouts is unilaterally 707 revoked by the server, it will effectively render useless *all* of 708 the client's layouts for files located on the storage units 709 comprising the logical volume. This may render useless the client's 710 layouts for files in other file systems. 712 2.4.4. Client Copy-on-Write Processing 714 Copy-on-write is a mechanism used to support file and/or file system 715 snapshots. When writing to unaligned regions, or to regions smaller 716 than a file system block, the writer must copy the portions of the 717 original file data to a new location on disk. This behavior can 718 either be implemented on the client or the server. The paragraphs 719 below describe how a pNFS SCSI layout client implements access to a 720 file that requires copy-on-write semantics. 722 Distinguishing the PNFS_SCSI_READ_WRITE_DATA and PNFS_SCSI_READ_DATA 723 extent types in combination with the allowed overlap of 724 PNFS_SCSI_READ_DATA extents with PNFS_SCSI_INVALID_DATA extents 725 allows copy-on-write processing to be done by pNFS clients. In 726 classic NFS, this operation would be done by the server. Since pNFS 727 enables clients to do direct block access, it is useful for clients 728 to participate in copy-on-write operations. All SCSI pNFS clients 729 MUST support this copy-on-write processing. 731 When a client wishes to write data covered by a PNFS_SCSI_READ_DATA 732 extent, it MUST have requested a writable layout from the server; 733 that layout will contain PNFS_SCSI_INVALID_DATA extents to cover all 734 the data ranges of that layout's PNFS_SCSI_READ_DATA extents. More 735 precisely, for any se_file_offset range covered by one or more 736 PNFS_SCSI_READ_DATA extents in a writable layout, the server MUST 737 include one or more PNFS_SCSI_INVALID_DATA extents in the layout that 738 cover the same se_file_offset range. When performing a write to such 739 an area of a layout, the client MUST effectively copy the data from 740 the PNFS_SCSI_READ_DATA extent for any partial blocks of 741 se_file_offset and range, merge in the changes to be written, and 742 write the result to the PNFS_SCSI_INVALID_DATA extent for the blocks 743 for that se_file_offset and range. That is, if entire blocks of data 744 are to be overwritten by an operation, the corresponding 745 PNFS_SCSI_READ_DATA blocks need not be fetched, but any partial- 746 block writes must be merged with data fetched via PNFS_SCSI_READ_DATA 747 extents before storing the result via PNFS_SCSI_INVALID_DATA extents. 748 For the purposes of this discussion, "entire blocks" and "partial 749 blocks" refer to the server's file-system block size. Storing of 750 data in a PNFS_SCSI_INVALID_DATA extent converts the written portion 751 of the PNFS_SCSI_INVALID_DATA extent to a PNFS_SCSI_READ_WRITE_DATA 752 extent; all subsequent reads MUST be performed from this extent; the 753 corresponding portion of the PNFS_SCSI_READ_DATA extent MUST NOT be 754 used after storing data in a PNFS_SCSI_INVALID_DATA extent. If a 755 client writes only a portion of an extent, the extent may be split at 756 block aligned boundaries. 758 When a client wishes to write data to a PNFS_SCSI_INVALID_DATA extent 759 that is not covered by a PNFS_SCSI_READ_DATA extent, it MUST treat 760 this write identically to a write to a file not involved with copy- 761 on-write semantics. Thus, data must be written in at least block- 762 sized increments, aligned to multiples of block-sized offsets, and 763 unwritten portions of blocks must be zero filled. 765 2.4.5. Extents are Permissions 767 Layout extents returned to pNFS clients grant permission to read or 768 write; PNFS_SCSI_READ_DATA and PNFS_SCSI_NONE_DATA are read-only 769 (PNFS_SCSI_NONE_DATA reads as zeroes), PNFS_SCSI_READ_WRITE_DATA and 770 PNFS_SCSI_INVALID_DATA are read/write, (PNFS_SCSI_INVALID_DATA reads 771 as zeros, any write converts it to PNFS_SCSI_READ_WRITE_DATA). This 772 is the only means a client has of obtaining permission to perform 773 direct I/O to storage devices; a pNFS client MUST NOT perform direct 774 I/O operations that are not permitted by an extent held by the 775 client. Client adherence to this rule places the pNFS server in 776 control of potentially conflicting storage device operations, 777 enabling the server to determine what does conflict and how to avoid 778 conflicts by granting and recalling extents to/from clients. 780 SCSI storage devices do not provide byte granularity access and can 781 only perform read and write operations atomically on a block 782 granularity, and thus require read-modify-write cycles to write data 783 smaller than the block size. Overlapping concurrent read and write 784 operations to the same data thus will cause the read to return a 785 mixture of before-write and after-write data. Additionally, data 786 corruption can occur if the underlying storage is striped and the 787 operations complete in different orders on different stripes. When 788 there are multiple clients who wish to access the same data, a pNFS 789 server MUST avoid these conflicts by implementing a concurrency 790 control policy of single writer XOR multiple readers for a given data 791 region. 793 If a client makes a layout request that conflicts with an existing 794 layout delegation, the request will be rejected with the error 795 NFS4ERR_LAYOUTTRYLATER. This client is then expected to retry the 796 request after a short interval. During this interval, the server 797 SHOULD recall the conflicting portion of the layout delegation from 798 the client that currently holds it. This reject-and-retry approach 799 does not prevent client starvation when there is contention for the 800 layout of a particular file. For this reason, a pNFS server SHOULD 801 implement a mechanism to prevent starvation. One possibility is that 802 the server can maintain a queue of rejected layout requests. Each 803 new layout request can be checked to see if it conflicts with a 804 previous rejected request, and if so, the newer request can be 805 rejected. Once the original requesting client retries its request, 806 its entry in the rejected request queue can be cleared, or the entry 807 in the rejected request queue can be removed when it reaches a 808 certain age. 810 NFSv4 supports mandatory locks and share reservations. These are 811 mechanisms that clients can use to restrict the set of I/O operations 812 that are permissible to other clients. Since all I/O operations 813 ultimately arrive at the NFSv4 server for processing, the server is 814 in a position to enforce these restrictions. However, with pNFS 815 layouts, I/Os will be issued from the clients that hold the layouts 816 directly to the storage devices that host the data. These devices 817 have no knowledge of files, mandatory locks, or share reservations, 818 and are not in a position to enforce such restrictions. For this 819 reason the NFSv4 server MUST NOT grant layouts that conflict with 820 mandatory locks or share reservations. Further, if a conflicting 821 mandatory lock request or a conflicting open request arrives at the 822 server, the server MUST recall the part of the layout in conflict 823 with the request before granting the request. 825 2.4.6. End-of-file Processing 827 The end-of-file location can be changed in two ways: implicitly as 828 the result of a WRITE or LAYOUTCOMMIT beyond the current end-of-file, 829 or explicitly as the result of a SETATTR request. Typically, when a 830 file is truncated by an NFSv4 client via the SETATTR call, the server 831 frees any disk blocks belonging to the file that are beyond the new 832 end-of-file byte, and MUST write zeros to the portion of the new end- 833 of-file block beyond the new end-of-file byte. These actions render 834 any pNFS layouts that refer to the blocks that are freed or written 835 semantically invalid. Therefore, the server MUST recall from clients 836 the portions of any pNFS layouts that refer to blocks that will be 837 freed or written by the server before processing the truncate 838 request. These recalls may take time to complete; as explained in 839 [RFC5661], if the server cannot respond to the client SETATTR request 840 in a reasonable amount of time, it SHOULD reply to the client with 841 the error NFS4ERR_DELAY. 843 Blocks in the PNFS_SCSI_INVALID_DATA state that lie beyond the new 844 end-of-file block present a special case. The server has reserved 845 these blocks for use by a pNFS client with a writable layout for the 846 file, but the client has yet to commit the blocks, and they are not 847 yet a part of the file mapping on disk. The server MAY free these 848 blocks while processing the SETATTR request. If so, the server MUST 849 recall any layouts from pNFS clients that refer to the blocks before 850 processing the truncate. If the server does not free the 851 PNFS_SCSI_INVALID_DATA blocks while processing the SETATTR request, 852 it need not recall layouts that refer only to the 853 PNFS_SCSI_INVALID_DATA blocks. 855 When a file is extended implicitly by a WRITE or LAYOUTCOMMIT beyond 856 the current end-of-file, or extended explicitly by a SETATTR request, 857 the server need not recall any portions of any pNFS layouts. 859 2.4.7. Layout Hints 861 The SETATTR operation supports a layout hint attribute [RFC5661]. 862 Clients MUST NOT set a layout hint with a layout type (the loh_type 863 field) of LAYOUT4_SCSI_VOLUME. 865 2.4.8. Client Fencing 867 The pNFS SCSI protocol must handle situations in which a system 868 failure, typically a network connectivity issue, requires the server 869 to unilaterally revoke extents from one client in order to transfer 870 the extents to another client. The pNFS server implementation MUST 871 ensure that when resources are transferred to another client, they 872 are not used by the client originally owning them, and this must be 873 ensured against any possible combination of partitions and delays 874 among all of the participants to the protocol (server, storage and 875 client). 877 The pNFS SCSI protocol implements fencing using Persistent 878 Reservations (PRs), similar to the fencing method used by existing 879 shared disk file systems. By placing a PR of type "Exclusive Access 880 - All Registrants" on each SCSI LU exported to pNFS clients the MDS 881 prevents access from any client that does not have an outstanding 882 device device ID that gives the client a reservation key to access 883 the LU, and allows the MDS to revoke access to the logic unit at any 884 time. 886 2.4.8.1. PRs - Key Generation 888 To allow fencing individual systems, each system must use a unique 889 Persistent Reservation key. [SPC3] does not specify a way to 890 generate keys. This document assigns the burden to generate unique 891 keys to the MDS, which must generate a key for itself before 892 exporting a volume, and one for each client that accesses a volume. 893 The MDS MAY either generate a key for each client that accesses logic 894 units exported by the MDS, or generate a key for each [LU, client] 895 combination. If using a single key per client, the MDS needs to be 896 aware of the per-client fencing granularity. 898 2.4.8.2. PRs - MDS Registration and Reservation 900 Before returning a PNFS_SCSI_VOLUME_BASE volume to the client, the 901 MDS needs to prepare the volume for fencing using PRs. This is done 902 by registering the reservation generated for the MDS with the device 903 using the "PERSISTENT RESERVE OUT" command with a service action of 904 "REGISTER", followed by a "PERSISTENT RESERVE OUT" command, with a 905 service action of "RESERVE" and the type field set to 8h (Exclusive 906 Access - All Registrants). To make sure all I_T nexuses are 907 registered, the MDS SHOULD set the "All Target Ports" (ALL_TG_PT) bit 908 when registering the key, or otherwise ensure the registration is 909 performed for each initiator port. 911 2.4.8.3. PRs - Client Registration 913 Before performing the first IO to a device returned from a 914 GETDEVICEINFO operation the client will register the registration key 915 returned in sbv_pr_key with the storage device by issuing a 916 "PERSISTENT RESERVE OUT" command with a service action of REGISTER 917 with the "SERVICE ACTION RESERVATION KEY" set to the reservation key 918 returned in sbv_pr_key. To make sure all I_T nexus are registered, 919 the client SHOULD set the "All Target Ports" (ALL_TG_PT) bit when 920 registering the key, or otherwise ensure the registration is 921 performed for each initiator port. 923 When a client stops using a device earlier returned by GETDEVICEINFO 924 it MUST unregister the earlier registered key by issuing a 925 "PERSISTENT RESERVE OUT" command with a service action of "REGISTER" 926 with the "RESERVATION KEY" set to the earlier registered reservation 927 key. 929 2.4.8.4. PRs - Fencing Action 931 In case of a non-responding client the MDS MUST fence the client by 932 issuing a "PERSISTENT RESERVE OUT" command with the service action 933 set to "PREEMPT" or "PREEMPT AND ABORT", the reservation key field 934 set to the server's reservation key, the service action reservation 935 key field set to the reservation key associated with the non- 936 responding client, and the type field set to 8h (Exclusive Access - 937 All Registrants). 939 After the MDS preempts a client, all client I/O to the LU fails. The 940 client should at this point return any layout that refers to the 941 device ID that points to the LU. Note that the client can 942 distinguish I/O errors due to fencing from other errors based on the 943 "RESERVATION CONFLICT" status. Refer to [SPC3] for details. 945 2.4.8.5. Client Recovery After a Fence Action 947 A client that detects I/O errors on the storage devices MUST commit 948 through the MDS, return all outstanding layouts for the device, 949 forget the device ID and unregister the reservation key. Future 950 GETDEVICEINFO calls may refer to the storage device again, in which 951 case a new registration will be performed. 953 2.5. Crash Recovery Issues 955 A critical requirement in crash recovery is that both the client and 956 the server know when the other has failed. Additionally, it is 957 required that a client sees a consistent view of data across server 958 restarts. These requirements and a full discussion of crash recovery 959 issues are covered in the "Crash Recovery" section of the NFSv41 960 specification [RFC5661]. This document contains additional crash 961 recovery material specific only to the SCSI layout. 963 When the server crashes while the client holds a writable layout, and 964 the client has written data to blocks covered by the layout, and the 965 blocks are still in the PNFS_SCSI_INVALID_DATA state, the client has 966 two options for recovery. If the data that has been written to these 967 blocks is still cached by the client, the client can simply re-write 968 the data via NFSv4, once the server has come back online. However, 969 if the data is no longer in the client's cache, the client MUST NOT 970 attempt to source the data from the data servers. Instead, it should 971 attempt to commit the blocks in question to the server during the 972 server's recovery grace period, by sending a LAYOUTCOMMIT with the 973 "loca_reclaim" flag set to true. This process is described in detail 974 in Section 18.42.4 of [RFC5661]. 976 2.6. Recalling Resources: CB_RECALL_ANY 978 The server may decide that it cannot hold all of the state for 979 layouts without running out of resources. In such a case, it is free 980 to recall individual layouts using CB_LAYOUTRECALL to reduce the 981 load, or it may choose to request that the client return any layout. 983 The NFSv4.1 spec [RFC5661] defines the following types: 985 const RCA4_TYPE_MASK_BLK_LAYOUT = 4; 987 struct CB_RECALL_ANY4args { 988 uint32_t craa_objects_to_keep; 989 bitmap4 craa_type_mask; 990 }; 992 When the server sends a CB_RECALL_ANY request to a client specifying 993 the RCA4_TYPE_MASK_BLK_LAYOUT bit in craa_type_mask, the client 994 should immediately respond with NFS4_OK, and then asynchronously 995 return complete file layouts until the number of files with layouts 996 cached on the client is less than craa_object_to_keep. 998 2.7. Transient and Permanent Errors 1000 The server may respond to LAYOUTGET with a variety of error statuses. 1001 These errors can convey transient conditions or more permanent 1002 conditions that are unlikely to be resolved soon. 1004 The transient errors, NFS4ERR_RECALLCONFLICT and NFS4ERR_TRYLATER, 1005 are used to indicate that the server cannot immediately grant the 1006 layout to the client. In the former case, this is because the server 1007 has recently issued a CB_LAYOUTRECALL to the requesting client, 1008 whereas in the case of NFS4ERR_TRYLATER, the server cannot grant the 1009 request possibly due to sharing conflicts with other clients. In 1010 either case, a reasonable approach for the client is to wait several 1011 milliseconds and retry the request. The client SHOULD track the 1012 number of retries, and if forward progress is not made, the client 1013 SHOULD send the READ or WRITE operation directly to the server. 1015 The error NFS4ERR_LAYOUTUNAVAILABLE may be returned by the server if 1016 layouts are not supported for the requested file or its containing 1017 file system. The server may also return this error code if the 1018 server is the progress of migrating the file from secondary storage, 1019 or for any other reason that causes the server to be unable to supply 1020 the layout. As a result of receiving NFS4ERR_LAYOUTUNAVAILABLE, the 1021 client SHOULD send future READ and WRITE requests directly to the 1022 server. It is expected that a client will not cache the file's 1023 layoutunavailable state forever, particular if the file is closed, 1024 and thus eventually, the client MAY reissue a LAYOUTGET operation. 1026 2.8. Volatile write caches 1028 Many storage devices implement volatile write caches that require an 1029 explicit flush to persist the data from write operations to stable 1030 storage. When a volatile write cache is used, the pNFS server must 1031 ensure the volatile write cache has been committed to stable storage 1032 before the LAYOUTCOMMIT operation returns. 1034 3. Security Considerations 1036 The functionality provided by SCSI Persistent Reservations makes it 1037 possible for the MDS to "fence" individual client machines from 1038 specific LUs -- that is to say, to prevent individual client machines 1039 from reading or writing to certain block devices. Finer-grained 1040 access control methods are not generally available. For this reason, 1041 certain security responsibilities are delegated to pNFS clients for 1042 SCSI layouts. SCSI storage devices generally control access at a LU 1043 granularity, and hence pNFS clients have to be trusted to only 1044 perform accesses allowed by the layout extents they currently hold 1045 (e.g., and not access storage for files on which a layout extent is 1046 not held). In general, the server will not be able to prevent a 1047 client that holds a layout for a file from accessing parts of the 1048 physical disk not covered by the layout. Similarly, the server will 1049 not be able to prevent a client from accessing blocks covered by a 1050 layout that it has already returned. This block-based level of 1051 protection must be provided by the client software. 1053 An alternative method of SCSI protocol use is for the storage devices 1054 to export virtualized block addresses, which do reflect the files to 1055 which blocks belong. These virtual block addresses are exported to 1056 pNFS clients via layouts. This allows the storage device to make 1057 appropriate access checks, while mapping virtual block addresses to 1058 physical block addresses. In environments where the security 1059 requirements are such that client-side protection from access to 1060 storage outside of the authorized layout extents is not sufficient, 1061 pNFS SCSI layouts SHOULD NOT be used unless the storage device is 1062 able to implement the appropriate access checks, via use of 1063 virtualized block addresses or other means. In contrast, an 1064 environment where client-side protection may suffice consists of co- 1065 located clients, server and storage devices in a data center with a 1066 physically isolated SAN under control of a single system 1067 administrator or small group of system administrators. 1069 This also has implications for some NFSv4 functionality outside pNFS. 1070 For instance, if a file is covered by a mandatory read-only lock, the 1071 server can ensure that only readable layouts for the file are granted 1072 to pNFS clients. However, it is up to each pNFS client to ensure 1073 that the readable layout is used only to service read requests, and 1074 not to allow writes to the existing parts of the file. Similarly, 1075 SCSI storage devices are unable to validate NFS Access Control Lists 1076 (ACLs) and file open modes, so the client must enforce the policies 1077 before sending a READ or WRITE request to the storage device. Since 1078 SCSI storage devices are generally not capable of enforcing such 1079 file-based security, in environments where pNFS clients cannot be 1080 trusted to enforce such policies, pNFS SCSI layouts SHOULD NOT be 1081 used. 1083 Access to SCSI storage devices is logically at a lower layer of the 1084 I/O stack than NFSv4, and hence NFSv4 security is not directly 1085 applicable to protocols that access such storage directly. Depending 1086 on the protocol, some of the security mechanisms provided by NFSv4 1087 (e.g., encryption, cryptographic integrity) may not be available or 1088 may be provided via different means. At one extreme, pNFS with SCSI 1089 layouts can be used with storage access protocols (e.g., parallel 1090 SCSI) that provide essentially no security functionality. At the 1091 other extreme, pNFS may be used with storage protocols such as iSCSI 1092 that can provide significant security functionality. It is the 1093 responsibility of those administering and deploying pNFS with a SCSI 1094 storage access protocol to ensure that appropriate protection is 1095 provided to that protocol (physical security is a common means for 1096 protocols not based on IP). In environments where the security 1097 requirements for the storage protocol cannot be met, pNFS SCSI 1098 layouts SHOULD NOT be used. 1100 When security is available for a storage protocol, it is generally at 1101 a different granularity and with a different notion of identity than 1102 NFSv4 (e.g., NFSv4 controls user access to files, iSCSI controls 1103 initiator access to volumes). The responsibility for enforcing 1104 appropriate correspondences between these security layers is placed 1105 upon the pNFS client. As with the issues in the first paragraph of 1106 this section, in environments where the security requirements are 1107 such that client-side protection from access to storage outside of 1108 the layout is not sufficient, pNFS SCSI layouts SHOULD NOT be used. 1110 4. IANA Considerations 1112 IANA is requested to assign a new pNFS layout type in the pNFS Layout 1113 Types Registry as follows (the value 5 is suggested): Layout Type 1114 Name: LAYOUT4_SCSI Value: 0x00000005 RFC: RFCTBD10 How: L (new layout 1115 type) Minor Versions: 1 1117 5. Normative References 1119 [LEGAL] IETF Trust, "Legal Provisions Relating to IETF Documents", 1120 November 2008, . 1123 [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate 1124 Requirement Levels", March 1997. 1126 [RFC4506] Eisler, M., "XDR: External Data Representation Standard", 1127 STD 67, RFC 4506, May 2006. 1129 [RFC5661] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 1130 "Network File System (NFS) Version 4 Minor Version 1 1131 Protocol", RFC 5661, January 2010. 1133 [RFC5662] Shepler, S., Ed., Eisler, M., Ed., and D. Noveck, Ed., 1134 "Network File System (NFS) Version 4 Minor Version 1 1135 External Data Representation Standard (XDR) Description", 1136 RFC 5662, January 2010. 1138 [RFC5663] Black, D., Ed., Fridella, S., Ed., and J. Glasgow, Ed., 1139 "Parallel NFS (pNFS) Block/Volume Layout", RFC 5663, 1140 January 2010. 1142 [RFC6688] Black, D., Ed., Glasgow, J., and S. Faibish, "Parallel NFS 1143 (pNFS) Block Disk Protection", RFC 6688, July 2012. 1145 [SAM-4] INCITS Technical Committee T10, "SCSI Architecture Model - 1146 4 (SAM-4)", ANSI INCITS 447-2008, ISO/IEC 14776-414, 2008. 1148 [SBC3] INCITS Technical Committee T10, "SCSI Block Commands-3", 1149 ANSI INCITS INCITS 514-2014, ISO/IEC 14776-323, 2014. 1151 [SPC3] INCITS Technical Committee T10, "SCSI Primary Commands-3", 1152 ANSI INCITS 408-2005, ISO/IEC 14776-453, 2005. 1154 Appendix A. Acknowledgments 1156 Large parts of this document were copied verbatim, and others were 1157 inspired by [RFC5663]. Thank to David Black, Stephen Fridella and 1158 Jason Glasgow for their work on the pNFS block/volume layout 1159 protocol. 1161 David Black, Robert Elliott and Tom Haynes provided a throughout 1162 review of early drafts of this document, and their input lead to the 1163 current form of the document. 1165 Appendix B. RFC Editor Notes 1167 [RFC Editor: please remove this section prior to publishing this 1168 document as an RFC] 1170 [RFC Editor: prior to publishing this document as an RFC, please 1171 replace all occurrences of RFCTBD10 with RFCxxxx where xxxx is the 1172 RFC number of this document] 1174 Author's Address 1176 Christoph Hellwig 1178 Email: hch@lst.de