draft-ietf-nfsv4-scsi-layout-08.txt   draft-ietf-nfsv4-scsi-layout-09.txt 
NFSv4 C. Hellwig NFSv4 C. Hellwig
Internet-Draft Internet-Draft
Intended status: Standards Track August 26, 2016 Intended status: Standards Track September 06, 2016
Expires: February 27, 2017 Expires: March 10, 2017
Parallel NFS (pNFS) SCSI Layout Parallel NFS (pNFS) SCSI Layout
draft-ietf-nfsv4-scsi-layout-08.txt draft-ietf-nfsv4-scsi-layout-09.txt
Abstract Abstract
The Parallel Network File System (pNFS) allows a separation between The Parallel Network File System (pNFS) allows a separation between
the metadata (onto a metadata server) and data (onto a storage the metadata (onto a metadata server) and data (onto a storage
device) for a file. The SCSI Layout Type is defined in this document device) for a file. The SCSI Layout Type is defined in this document
as an extension to pNFS to allow the use SCSI based block storage as an extension to pNFS to allow the use SCSI based block storage
devices. devices.
Status of This Memo Status of This Memo
skipping to change at page 1, line 34 skipping to change at page 1, line 34
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
Task Force (IETF). Note that other groups may also distribute Task Force (IETF). Note that other groups may also distribute
working documents as Internet-Drafts. The list of current Internet- working documents as Internet-Drafts. The list of current Internet-
Drafts is at http://datatracker.ietf.org/drafts/current/. Drafts is at http://datatracker.ietf.org/drafts/current/.
Internet-Drafts are draft documents valid for a maximum of six months Internet-Drafts are draft documents valid for a maximum of six months
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
This Internet-Draft will expire on February 27, 2017. This Internet-Draft will expire on March 10, 2017.
Copyright Notice Copyright Notice
Copyright (c) 2016 IETF Trust and the persons identified as the Copyright (c) 2016 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents Provisions Relating to IETF Documents
(http://trustee.ietf.org/license-info) in effect on the date of (http://trustee.ietf.org/license-info) in effect on the date of
publication of this document. Please review these documents publication of this document. Please review these documents
skipping to change at page 2, line 11 skipping to change at page 2, line 11
include Simplified BSD License text as described in Section 4.e of include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License. described in the Simplified BSD License.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2
1.1. Conventions Used in This Document . . . . . . . . . . . . 4 1.1. Conventions Used in This Document . . . . . . . . . . . . 4
1.2. General Definitions . . . . . . . . . . . . . . . . . . . 4 1.2. General Definitions . . . . . . . . . . . . . . . . . . . 4
1.3. Code Components Licensing Notice . . . . . . . . . . . . 4 1.3. Code Components Licensing Notice . . . . . . . . . . . . 4
1.4. XDR Description . . . . . . . . . . . . . . . . . . . . . 4 1.4. XDR Description . . . . . . . . . . . . . . . . . . . . . 5
2. SCSI Layout Description . . . . . . . . . . . . . . . . . . . 6 2. SCSI Layout Description . . . . . . . . . . . . . . . . . . . 6
2.1. Background and Architecture . . . . . . . . . . . . . . . 6 2.1. Background and Architecture . . . . . . . . . . . . . . . 6
2.2. layouttype4 . . . . . . . . . . . . . . . . . . . . . . . 7 2.2. layouttype4 . . . . . . . . . . . . . . . . . . . . . . . 8
2.3. GETDEVICEINFO . . . . . . . . . . . . . . . . . . . . . . 8 2.3. GETDEVICEINFO . . . . . . . . . . . . . . . . . . . . . . 8
2.3.1. Volume Identification . . . . . . . . . . . . . . . . 8 2.3.1. Volume Identification . . . . . . . . . . . . . . . . 8
2.3.2. Volume Topology . . . . . . . . . . . . . . . . . . . 9 2.3.2. Volume Topology . . . . . . . . . . . . . . . . . . . 9
2.4. Data Structures: Extents and Extent Lists . . . . . . . . 12 2.4. Data Structures: Extents and Extent Lists . . . . . . . . 12
2.4.1. Layout Requests and Extent Lists . . . . . . . . . . 14 2.4.1. Layout Requests and Extent Lists . . . . . . . . . . 14
2.4.2. Layout Commits . . . . . . . . . . . . . . . . . . . 15 2.4.2. Layout Commits . . . . . . . . . . . . . . . . . . . 15
2.4.3. Layout Returns . . . . . . . . . . . . . . . . . . . 16 2.4.3. Layout Returns . . . . . . . . . . . . . . . . . . . 16
2.4.4. Layout Revocation . . . . . . . . . . . . . . . . . . 16 2.4.4. Layout Revocation . . . . . . . . . . . . . . . . . . 16
2.4.5. Client Copy-on-Write Processing . . . . . . . . . . . 17 2.4.5. Client Copy-on-Write Processing . . . . . . . . . . . 17
2.4.6. Extents are Permissions . . . . . . . . . . . . . . . 18 2.4.6. Extents are Permissions . . . . . . . . . . . . . . . 18
skipping to change at page 3, line 45 skipping to change at page 3, line 45
supported by the SCSI layout type, and all future references to SCSI supported by the SCSI layout type, and all future references to SCSI
storage devices will imply a block based SCSI command set. storage devices will imply a block based SCSI command set.
The Server to Storage System protocol, called the "Control Protocol", The Server to Storage System protocol, called the "Control Protocol",
is not of concern for interoperability, although it will typically be is not of concern for interoperability, although it will typically be
the same SCSI based storage protocol. the same SCSI based storage protocol.
This document is based on [RFC5663] and makes changes to the block This document is based on [RFC5663] and makes changes to the block
layout type to provide a better pNFS layout protocol for SCSI based layout type to provide a better pNFS layout protocol for SCSI based
storage devices. Despite these changes, [RFC5663] remains the storage devices. Despite these changes, [RFC5663] remains the
defining document for the existing block layout type. [RFC6688] is defining document for the existing block layout type. pNFS Block Disk
unnecessary in the context of the SCSI layout type because the new Protection [RFC6688] is unnecessary in the context of the SCSI layout
layout type provides mandatory disk access protection as part of the type because the new layout type provides mandatory disk access
layout type definition. In contrast to [RFC5663], this document uses protection as part of the layout type definition. In contrast to
SCSI protocol features to provide reliable fencing by using SCSI [RFC5663], this document uses SCSI protocol features to provide
Persistent Reservations, and it can provide reliable and efficient reliable fencing by using SCSI Persistent Reservations, and it can
device discovery by using SCSI device identifiers instead of having provide reliable and efficient device discovery by using SCSI device
to rely on probing all devices potentially attached to a client. identifiers instead of having to rely on probing all devices
potentially attached to a client. This new layout type also
This new layout type also optimizes the I/O path by reducing the size optimizes the I/O path by reducing the size of the LAYOUTCOMMIT
of the LAYOUTCOMMIT payload. payload.
The above two paragraphs summarize the major functional differences The above two paragraphs summarize the major functional differences
from [RFC5663]. There are other minor differences, e.g., the "base" from [RFC5663]. There are other minor differences, e.g., the "base"
volume type in this specification is used instead of the "simple" volume type in this specification is used instead of the "simple"
volume type in [RFC5663], but there are no significant differences in volume type in [RFC5663], but there are no significant differences in
the data structures that describe the volume topology above this the data structures that describe the volume topology above this
level Section 2.3.2 or in the data structures that describe extents level Section 2.3.2 or in the data structures that describe extents
Section 2.4. Section 2.4.
1.1. Conventions Used in This Document 1.1. Conventions Used in This Document
skipping to change at page 4, line 40 skipping to change at page 4, line 40
Client The "client" is the entity that accesses the NFS server's Client The "client" is the entity that accesses the NFS server's
resources. The client may be an application that contains the resources. The client may be an application that contains the
logic to access the NFS server directly. The client may also be logic to access the NFS server directly. The client may also be
the traditional operating system client that provides remote file the traditional operating system client that provides remote file
system services for a set of applications. system services for a set of applications.
Server The "server" is the entity responsible for coordinating Server The "server" is the entity responsible for coordinating
client access to a set of file systems and is identified by a client access to a set of file systems and is identified by a
server owner. server owner.
metadata server (MDS) The metadata server is a pNFS server which
provides metadata information for a file system object. It also
is responsible for generating layouts for file system objects.
Note that the MDS is also responsible for directory-based
operations.
1.3. Code Components Licensing Notice 1.3. Code Components Licensing Notice
The external data representation (XDR) description and scripts for The external data representation (XDR) description and scripts for
extracting the XDR description are Code Components as described in extracting the XDR description are Code Components as described in
Section 4 of "Legal Provisions Relating to IETF Documents" [LEGAL]. Section 4 of "Legal Provisions Relating to IETF Documents" [LEGAL].
These Code Components are licensed according to the terms of These Code Components are licensed according to the terms of
Section 4 of "Legal Provisions Relating to IETF Documents". Section 4 of "Legal Provisions Relating to IETF Documents".
1.4. XDR Description 1.4. XDR Description
This document contains the XDR [RFC4506] description of the NFSv4.1 This document contains the XDR [RFC4506] description of the NFSv4.1
SCSI layout protocol. The XDR description is embedded in this SCSI layout protocol. The XDR description is embedded in this
document in a way that makes it simple for the reader to extract into document in a way that makes it simple for the reader to extract into
a ready-to-compile form. The reader can feed this document into the a ready-to-compile form. The reader can feed this document into the
following shell script to produce the machine readable XDR following shell script to produce the machine readable XDR
skipping to change at page 7, line 43 skipping to change at page 7, line 50
o Similarly, SCSI storage devices typically are not able to validate o Similarly, SCSI storage devices typically are not able to validate
NFS locks that apply to file regions. For instance, if a file is NFS locks that apply to file regions. For instance, if a file is
covered by a mandatory read-only lock, the server can ensure that covered by a mandatory read-only lock, the server can ensure that
only readable layouts for the file are granted to pNFS clients. only readable layouts for the file are granted to pNFS clients.
However, it is up to each pNFS client to ensure that the readable However, it is up to each pNFS client to ensure that the readable
layout is used only to service read requests, and not to allow layout is used only to service read requests, and not to allow
writes to the existing parts of the file. writes to the existing parts of the file.
Since SCSI storage devices are generally not capable of enforcing Since SCSI storage devices are generally not capable of enforcing
such file-based security, in environments where pNFS clients cannot such file-based security, in environments where pNFS clients cannot
be trusted to enforce such policies, pNFS SCSI layouts SHOULD NOT be be trusted to enforce such policies, pNFS SCSI layouts MUST NOT be
used. used.
2.2. layouttype4 2.2. layouttype4
The layout4 type defined in [RFC5662] is extended with a new value as The layout4 type defined in [RFC5662] is extended with a new value as
follows: follows:
enum layouttype4 { enum layouttype4 {
LAYOUT4_NFSV4_1_FILES = 1, LAYOUT4_NFSV4_1_FILES = 1,
LAYOUT4_OSD2_OBJECTS = 2, LAYOUT4_OSD2_OBJECTS = 2,
skipping to change at page 9, line 11 skipping to change at page 9, line 14
Any other association or designator type MUST NOT be used. Use Any other association or designator type MUST NOT be used. Use
of T10 vendor IDs is discouraged when one of the other types can of T10 vendor IDs is discouraged when one of the other types can
be used. be used.
The "CODE SET" VPD page field is stored in the "sbv_code_set" field The "CODE SET" VPD page field is stored in the "sbv_code_set" field
of the "pnfs_scsi_base_volume_info4" structure, the "DESIGNATOR TYPE" of the "pnfs_scsi_base_volume_info4" structure, the "DESIGNATOR TYPE"
is stored in "sbv_designator_type", and the DESIGNATOR is stored in is stored in "sbv_designator_type", and the DESIGNATOR is stored in
"sbv_designator". Due to the use of a XDR array the "DESIGNATOR "sbv_designator". Due to the use of a XDR array the "DESIGNATOR
LENGTH" field does not need to be set separately. Only certain LENGTH" field does not need to be set separately. Only certain
combinations of "sbv_code_set" and "sbv_designator_type" are valid, combinations of "sbv_code_set" and "sbv_designator_type" are valid,
please refer to [SPC4] for details, and note that ASCII may be used please refer to [SPC4] for details, and note that ASCII MAY be used
as the code set for UTF-8 text that contains only printable ASCII as the code set for UTF-8 text that contains only printable ASCII
characters. Note that a Device Identification VPD page MAY contain characters. Note that a Device Identification VPD page MAY contain
multiple descriptors with the same association, code set and multiple descriptors with the same association, code set and
designator type. NFS clients thus MUST check all the descriptors for designator type. NFS clients thus MUST check all the descriptors for
a possible match to "sbv_code_set", "sbv_designator_type" and a possible match to "sbv_code_set", "sbv_designator_type" and
"sbv_designator". "sbv_designator".
Storage devices such as storage arrays can have multiple physical Storage devices such as storage arrays can have multiple physical
network ports that need not be connected to a common network, network ports that need not be connected to a common network,
resulting in a pNFS client having simultaneous multipath access to resulting in a pNFS client having simultaneous multipath access to
skipping to change at page 9, line 34 skipping to change at page 9, line 37
left up to the client. left up to the client.
Additionally the server returns a Persistent Reservation key in the Additionally the server returns a Persistent Reservation key in the
"sbv_pr_key" field. See Section 2.4.10 for more details on the use "sbv_pr_key" field. See Section 2.4.10 for more details on the use
of Persistent Reservations. of Persistent Reservations.
2.3.2. Volume Topology 2.3.2. Volume Topology
The pNFS SCSI layout volume topology is expressed in terms of the The pNFS SCSI layout volume topology is expressed in terms of the
volume types described below. The individual components of the volume types described below. The individual components of the
topology are contained in an array and components may refer to other topology are contained in an array and components MAY refer to other
components by using array indices. components by using array indices.
/// enum pnfs_scsi_volume_type4 { /// enum pnfs_scsi_volume_type4 {
/// PNFS_SCSI_VOLUME_SLICE = 1, /* volume is a slice of /// PNFS_SCSI_VOLUME_SLICE = 1, /* volume is a slice of
/// another volume */ /// another volume */
/// PNFS_SCSI_VOLUME_CONCAT = 2, /* volume is a /// PNFS_SCSI_VOLUME_CONCAT = 2, /* volume is a
/// concatenation of /// concatenation of
/// multiple volumes */ /// multiple volumes */
/// PNFS_SCSI_VOLUME_STRIPE = 3 /* volume is striped across /// PNFS_SCSI_VOLUME_STRIPE = 3 /* volume is striped across
/// multiple volumes */ /// multiple volumes */
skipping to change at page 11, line 49 skipping to change at page 11, line 49
element of the array. Concat, slice, and stripe volumes MUST refer element of the array. Concat, slice, and stripe volumes MUST refer
to volumes defined by lower indexed elements of the array. to volumes defined by lower indexed elements of the array.
The "pnfs_scsi_device_addr4" data structure is returned by the server The "pnfs_scsi_device_addr4" data structure is returned by the server
as the storage-protocol-specific opaque field da_addr_body in the as the storage-protocol-specific opaque field da_addr_body in the
"device_addr4" structure by a successful GETDEVICEINFO operation "device_addr4" structure by a successful GETDEVICEINFO operation
[RFC5661]. [RFC5661].
As noted above, all device_addr4 structures eventually resolve to a As noted above, all device_addr4 structures eventually resolve to a
set of volumes of type PNFS_SCSI_VOLUME_BASE. Complicated volume set of volumes of type PNFS_SCSI_VOLUME_BASE. Complicated volume
hierarchies may be composed of dozens of volumes each with several hierarchies MAY be composed of dozens of volumes each with several
components; thus, the device address may require several kilobytes. components; thus, the device address MAY require several kilobytes.
The client SHOULD be prepared to allocate a large buffer to contain The client SHOULD be prepared to allocate a large buffer to contain
the result. In the case of the server returning NFS4ERR_TOOSMALL, the result. In the case of the server returning NFS4ERR_TOOSMALL,
the client SHOULD allocate a buffer of at least gdir_mincount_bytes the client SHOULD allocate a buffer of at least gdir_mincount_bytes
to contain the expected result and retry the GETDEVICEINFO request. to contain the expected result and retry the GETDEVICEINFO request.
2.4. Data Structures: Extents and Extent Lists 2.4. Data Structures: Extents and Extent Lists
A pNFS SCSI layout is a list of extents within a flat array of data A pNFS SCSI layout is a list of extents within a flat array of data
blocks in a volume. The details of the volume topology can be blocks in a volume. The details of the volume topology can be
determined by using the GETDEVICEINFO operation. The SCSI layout determined by using the GETDEVICEINFO operation. The SCSI layout
skipping to change at page 13, line 47 skipping to change at page 13, line 47
LU. The se_file_offset, se_length, and se_state fields for an extent LU. The se_file_offset, se_length, and se_state fields for an extent
returned from the server are valid for all extents. In contrast, the returned from the server are valid for all extents. In contrast, the
interpretation of the se_storage_offset field depends on the value of interpretation of the se_storage_offset field depends on the value of
se_state as follows (in increasing order): se_state as follows (in increasing order):
PNFS_SCSI_READ_WRITE_DATA means that se_storage_offset is valid, and PNFS_SCSI_READ_WRITE_DATA means that se_storage_offset is valid, and
points to valid/initialized data that can be read and written. points to valid/initialized data that can be read and written.
PNFS_SCSI_READ_DATA means that se_storage_offset is valid and points PNFS_SCSI_READ_DATA means that se_storage_offset is valid and points
to valid/initialized data that can only be read. Write operations to valid/initialized data that can only be read. Write operations
are prohibited; the client may need to request a read-write are prohibited; the client MAY need to request a read-write
layout. layout.
PNFS_SCSI_INVALID_DATA means that se_storage_offset is valid, but PNFS_SCSI_INVALID_DATA means that se_storage_offset is valid, but
points to invalid un-initialized data. This data must not be read points to invalid un-initialized data. This data MUST not be read
from the disk until it has been initialized. A read request for a from the disk until it has been initialized. A read request for a
PNFS_SCSI_INVALID_DATA extent must fill the user buffer with PNFS_SCSI_INVALID_DATA extent MUST fill the user buffer with
zeros, unless the extent is covered by a PNFS_SCSI_READ_DATA zeros, unless the extent is covered by a PNFS_SCSI_READ_DATA
extent of a copy-on-write file system. Write requests must write extent of a copy-on-write file system. Write requests MUST write
whole server-sized blocks to the disk; bytes not initialized by whole server-sized blocks to the disk; bytes not initialized by
the user must be set to zero. Any write to storage in a the user MUST be set to zero. Any write to storage in a
PNFS_SCSI_INVALID_DATA extent changes the written portion of the PNFS_SCSI_INVALID_DATA extent changes the written portion of the
extent to PNFS_SCSI_READ_WRITE_DATA; the pNFS client is extent to PNFS_SCSI_READ_WRITE_DATA; the pNFS client is
responsible for reporting this change via LAYOUTCOMMIT. responsible for reporting this change via LAYOUTCOMMIT.
PNFS_SCSI_NONE_DATA means that se_storage_offset is not valid, and PNFS_SCSI_NONE_DATA means that se_storage_offset is not valid, and
this extent may not be used to satisfy write requests. Read this extent MAY not be used to satisfy write requests. Read
requests may be satisfied by zero-filling as for requests MAY be satisfied by zero-filling as for
PNFS_SCSI_INVALID_DATA. PNFS_SCSI_NONE_DATA extents may be PNFS_SCSI_INVALID_DATA. PNFS_SCSI_NONE_DATA extents MAY be
returned by requests for readable extents; they are never returned returned by requests for readable extents; they are never returned
if the request was for a writable extent. if the request was for a writable extent.
An extent list contains all relevant extents in increasing order of An extent list contains all relevant extents in increasing order of
the se_file_offset of each extent; any ties are broken by increasing the se_file_offset of each extent; any ties are broken by increasing
order of the extent state (se_state). order of the extent state (se_state).
2.4.1. Layout Requests and Extent Lists 2.4.1. Layout Requests and Extent Lists
Each request for a layout specifies at least three parameters: file Each request for a layout specifies at least three parameters: file
offset, desired size, and minimum size. If the status of a request offset, desired size, and minimum size. If the status of a request
indicates success, the extent list returned must meet the following indicates success, the extent list returned MUST meet the following
criteria: criteria:
o A request for a readable (but not writable) layout MUST return o A request for a readable (but not writable) layout MUST return
either PNFS_SCSI_READ_DATA or PNFS_SCSI_NONE_DATA extents. It either PNFS_SCSI_READ_DATA or PNFS_SCSI_NONE_DATA extents. It
SHALL NOT return PNFS_SCSI_INVALID_DATA or SHALL NOT return PNFS_SCSI_INVALID_DATA or
PNFS_SCSI_READ_WRITE_DATA extents. PNFS_SCSI_READ_WRITE_DATA extents.
o A request for a writable layout MUST return o A request for a writable layout MUST return
PNFS_SCSI_READ_WRITE_DATA or PNFS_SCSI_INVALID_DATA extents, and PNFS_SCSI_READ_WRITE_DATA or PNFS_SCSI_INVALID_DATA extents, and
it MAY return addition PNFS_SCSI_READ_DATA extents for ranges it MAY return addition PNFS_SCSI_READ_DATA extents for ranges
skipping to change at page 16, line 4 skipping to change at page 16, line 4
/// pnfs_scsi_range4 slu_commit_list<>; /// pnfs_scsi_range4 slu_commit_list<>;
/// /* list of extents which /// /* list of extents which
/// * now contain valid data. /// * now contain valid data.
/// */ /// */
/// }; /// };
The "pnfs_scsi_layoutupdate4" structure is used by the client as the The "pnfs_scsi_layoutupdate4" structure is used by the client as the
SCSI layout-specific argument in a LAYOUTCOMMIT operation. The SCSI layout-specific argument in a LAYOUTCOMMIT operation. The
"slu_commit_list" field is a list covering regions of the file layout "slu_commit_list" field is a list covering regions of the file layout
that were previously in the PNFS_SCSI_INVALID_DATA state, but have that were previously in the PNFS_SCSI_INVALID_DATA state, but have
been written by the client and should now be considered in the been written by the client and SHOULD now be considered in the
PNFS_SCSI_READ_WRITE_DATA state. The extents in the commit list MUST PNFS_SCSI_READ_WRITE_DATA state. The extents in the commit list MUST
be disjoint and MUST be sorted by sr_file_offset. Implementors be disjoint and MUST be sorted by sr_file_offset. Implementors
should be aware that a server may be unable to commit regions at a should be aware that a server MAY be unable to commit regions at a
granularity smaller than a file-system block (typically 4 KB or 8 granularity smaller than a file-system block (typically 4 KB or 8
KB). As noted above, the block-size that the server uses is KB). As noted above, the block-size that the server uses is
available as an NFSv4 attribute, and any extents included in the available as an NFSv4 attribute, and any extents included in the
"slu_commit_list" MUST be aligned to this granularity and have a size "slu_commit_list" MUST be aligned to this granularity and have a size
that is a multiple of this granularity. Since the block in question that is a multiple of this granularity. Since the block in question
is in state PNFS_SCSI_INVALID_DATA, byte ranges not written should be is in state PNFS_SCSI_INVALID_DATA, byte ranges not written SHOULD be
filled with zeros. This applies even if it appears that the area filled with zeros. This applies even if it appears that the area
being written is beyond what the client believes to be the end of being written is beyond what the client believes to be the end of
file. file.
2.4.3. Layout Returns 2.4.3. Layout Returns
A LAYOUTRETURN operation represents an explicit release of resources A LAYOUTRETURN operation represents an explicit release of resources
by the client. This may be done in response to a CB_LAYOUTRECALL or by the client. This MAY be done in response to a CB_LAYOUTRECALL or
before any recall, in order to avoid a future CB_LAYOUTRECALL. When before any recall, in order to avoid a future CB_LAYOUTRECALL. When
the LAYOUTRETURN operation specifies a LAYOUTRETURN4_FILE return the LAYOUTRETURN operation specifies a LAYOUTRETURN4_FILE return
type, then the layoutreturn_file4 data structure specifies the region type, then the layoutreturn_file4 data structure specifies the region
of the file layout that is no longer needed by the client. of the file layout that is no longer needed by the client.
The LAYOUTRETURN operation is done without any SCSI layout specific The LAYOUTRETURN operation is done without any SCSI layout specific
data. The opaque "lrf_body" field of the "layoutreturn_file4" data data. The opaque "lrf_body" field of the "layoutreturn_file4" data
structure MUST have length zero. structure MUST have length zero.
2.4.4. Layout Revocation 2.4.4. Layout Revocation
Layouts may be unilaterally revoked by the server, due to the Layouts MAY be unilaterally revoked by the server, due to the
client's lease time expiring, or the client failing to return a client's lease time expiring, or the client failing to return a
layout which has been recalled in a timely manner. For the SCSI layout which has been recalled in a timely manner. For the SCSI
layout type this is accomplished by fencing off the client from layout type this is accomplished by fencing off the client from
access to storage as described in Section 2.4.10. When this is done, access to storage as described in Section 2.4.10. When this is done,
it is necessary that all I/Os issued by the fenced-off client be it is necessary that all I/Os issued by the fenced-off client be
rejected by the storage This includes any in-flight I/Os that the rejected by the storage This includes any in-flight I/Os that the
client issued before the layout was revoked. client issued before the layout was revoked.
Note, that the granularity of this operation can only be at the host/ Note, that the granularity of this operation can only be at the host/
LU level. Thus, if one of a client's layouts is unilaterally revoked LU level. Thus, if one of a client's layouts is unilaterally revoked
by the server, it will effectively render useless *all* of the by the server, it will effectively render useless *all* of the
client's layouts for files located on the storage units comprising client's layouts for files located on the storage units comprising
the volume. This may render useless the client's layouts for files the volume. This may render useless the client's layouts for files
in other file systems. See Section 2.4.10.5 for a discussion of in other file systems. See Section 2.4.10.5 for a discussion of
recovery from from fencing. recovery from from fencing.
2.4.5. Client Copy-on-Write Processing 2.4.5. Client Copy-on-Write Processing
Copy-on-write is a mechanism used to support file and/or file system Copy-on-write is a mechanism used to support file and/or file system
snapshots. When writing to unaligned regions, or to regions smaller snapshots. When writing to unaligned regions, or to regions smaller
than a file system block, the writer must copy the portions of the than a file system block, the writer MUST copy the portions of the
original file data to a new location on disk. This behavior can original file data to a new location on disk. This behavior can
either be implemented on the client or the server. The paragraphs either be implemented on the client or the server. The paragraphs
below describe how a pNFS SCSI layout client implements access to a below describe how a pNFS SCSI layout client implements access to a
file that requires copy-on-write semantics. file that requires copy-on-write semantics.
Distinguishing the PNFS_SCSI_READ_WRITE_DATA and PNFS_SCSI_READ_DATA Distinguishing the PNFS_SCSI_READ_WRITE_DATA and PNFS_SCSI_READ_DATA
extent types in combination with the allowed overlap of extent types in combination with the allowed overlap of
PNFS_SCSI_READ_DATA extents with PNFS_SCSI_INVALID_DATA extents PNFS_SCSI_READ_DATA extents with PNFS_SCSI_INVALID_DATA extents
allows copy-on-write processing to be done by pNFS clients. In allows copy-on-write processing to be done by pNFS clients. In
classic NFS, this operation would be done by the server. Since pNFS classic NFS, this operation would be done by the server. Since pNFS
skipping to change at page 17, line 39 skipping to change at page 17, line 39
PNFS_SCSI_READ_DATA extents in a writable layout, the server MUST PNFS_SCSI_READ_DATA extents in a writable layout, the server MUST
include one or more PNFS_SCSI_INVALID_DATA extents in the layout that include one or more PNFS_SCSI_INVALID_DATA extents in the layout that
cover the same se_file_offset range. When performing a write to such cover the same se_file_offset range. When performing a write to such
an area of a layout, the client MUST effectively copy the data from an area of a layout, the client MUST effectively copy the data from
the PNFS_SCSI_READ_DATA extent for any partial blocks of the PNFS_SCSI_READ_DATA extent for any partial blocks of
se_file_offset and range, merge in the changes to be written, and se_file_offset and range, merge in the changes to be written, and
write the result to the PNFS_SCSI_INVALID_DATA extent for the blocks write the result to the PNFS_SCSI_INVALID_DATA extent for the blocks
for that se_file_offset and range. That is, if entire blocks of data for that se_file_offset and range. That is, if entire blocks of data
are to be overwritten by an operation, the corresponding are to be overwritten by an operation, the corresponding
PNFS_SCSI_READ_DATA blocks need not be fetched, but any partial- PNFS_SCSI_READ_DATA blocks need not be fetched, but any partial-
block writes must be merged with data fetched via PNFS_SCSI_READ_DATA block writes MUST be merged with data fetched via PNFS_SCSI_READ_DATA
extents before storing the result via PNFS_SCSI_INVALID_DATA extents. extents before storing the result via PNFS_SCSI_INVALID_DATA extents.
For the purposes of this discussion, "entire blocks" and "partial For the purposes of this discussion, "entire blocks" and "partial
blocks" refer to the server's file-system block size. Storing of blocks" refer to the server's file-system block size. Storing of
data in a PNFS_SCSI_INVALID_DATA extent converts the written portion data in a PNFS_SCSI_INVALID_DATA extent converts the written portion
of the PNFS_SCSI_INVALID_DATA extent to a PNFS_SCSI_READ_WRITE_DATA of the PNFS_SCSI_INVALID_DATA extent to a PNFS_SCSI_READ_WRITE_DATA
extent; all subsequent reads MUST be performed from this extent; the extent; all subsequent reads MUST be performed from this extent; the
corresponding portion of the PNFS_SCSI_READ_DATA extent MUST NOT be corresponding portion of the PNFS_SCSI_READ_DATA extent MUST NOT be
used after storing data in a PNFS_SCSI_INVALID_DATA extent. If a used after storing data in a PNFS_SCSI_INVALID_DATA extent. If a
client writes only a portion of an extent, the extent may be split at client writes only a portion of an extent, the extent MAY be split at
block aligned boundaries. block aligned boundaries.
When a client wishes to write data to a PNFS_SCSI_INVALID_DATA extent When a client wishes to write data to a PNFS_SCSI_INVALID_DATA extent
that is not covered by a PNFS_SCSI_READ_DATA extent, it MUST treat that is not covered by a PNFS_SCSI_READ_DATA extent, it MUST treat
this write identically to a write to a file not involved with copy- this write identically to a write to a file not involved with copy-
on-write semantics. Thus, data must be written in at least block- on-write semantics. Thus, data MUST be written in at least block-
sized increments, aligned to multiples of block-sized offsets, and sized increments, aligned to multiples of block-sized offsets, and
unwritten portions of blocks must be zero filled. unwritten portions of blocks MUST be zero filled.
2.4.6. Extents are Permissions 2.4.6. Extents are Permissions
Layout extents returned to pNFS clients grant permission to read or Layout extents returned to pNFS clients grant permission to read or
write; PNFS_SCSI_READ_DATA and PNFS_SCSI_NONE_DATA are read-only write; PNFS_SCSI_READ_DATA and PNFS_SCSI_NONE_DATA are read-only
(PNFS_SCSI_NONE_DATA reads as zeroes), PNFS_SCSI_READ_WRITE_DATA and (PNFS_SCSI_NONE_DATA reads as zeroes), PNFS_SCSI_READ_WRITE_DATA and
PNFS_SCSI_INVALID_DATA are read/write, (PNFS_SCSI_INVALID_DATA reads PNFS_SCSI_INVALID_DATA are read/write, (PNFS_SCSI_INVALID_DATA reads
as zeros, any write converts it to PNFS_SCSI_READ_WRITE_DATA). This as zeros, any write converts it to PNFS_SCSI_READ_WRITE_DATA). This
is the only means a client has of obtaining permission to perform is the only means a client has of obtaining permission to perform
direct I/O to storage devices; a pNFS client MUST NOT perform direct direct I/O to storage devices; a pNFS client MUST NOT perform direct
skipping to change at page 20, line 32 skipping to change at page 20, line 32
to unilaterally revoke extents from a client after the client fails to unilaterally revoke extents from a client after the client fails
to respond to a CB_LAYOUTRECALL request. This is implemented by to respond to a CB_LAYOUTRECALL request. This is implemented by
fencing off a non-responding client from access to the storage fencing off a non-responding client from access to the storage
device. device.
The pNFS SCSI protocol implements fencing using Persistent The pNFS SCSI protocol implements fencing using Persistent
Reservations (PRs), similar to the fencing method used by existing Reservations (PRs), similar to the fencing method used by existing
shared disk file systems. By placing a PR of type "Exclusive Access shared disk file systems. By placing a PR of type "Exclusive Access
- Registrants Only" on each SCSI LU exported to pNFS clients the MDS - Registrants Only" on each SCSI LU exported to pNFS clients the MDS
prevents access from any client that does not have an outstanding prevents access from any client that does not have an outstanding
device device ID that gives the client a reservation key to access device ID that gives the client a reservation key to access the LU,
the LU, and allows the MDS to revoke access to the logic unit at any and allows the MDS to revoke access to the logic unit at any time.
time.
2.4.10.1. PRs - Key Generation 2.4.10.1. PRs - Key Generation
To allow fencing individual systems, each system must use a unique To allow fencing individual systems, each system MUST use a unique
Persistent Reservation key. [SPC4] does not specify a way to Persistent Reservation key. [SPC4] does not specify a way to
generate keys. This document assigns the burden to generate unique generate keys. This document assigns the burden to generate unique
keys to the MDS, which must generate a key for itself before keys to the MDS, which MUST generate a key for itself before
exporting a volume, and a key for each client that accesses SCSI exporting a volume, and a key for each client that accesses SCSI
layout volumes. Individuals keys for each volume that a client can layout volumes. Individuals keys for each volume that a client can
access are permitted but not required. access are permitted but not required.
2.4.10.2. PRs - MDS Registration and Reservation 2.4.10.2. PRs - MDS Registration and Reservation
Before returning a PNFS_SCSI_VOLUME_BASE volume to the client, the Before returning a PNFS_SCSI_VOLUME_BASE volume to the client, the
MDS needs to prepare the volume for fencing using PRs. This is done MDS needs to prepare the volume for fencing using PRs. This is done
by registering the reservation generated for the MDS with the device by registering the reservation generated for the MDS with the device
using the "PERSISTENT RESERVE OUT" command with a service action of using the "PERSISTENT RESERVE OUT" command with a service action of
skipping to change at page 21, line 41 skipping to change at page 21, line 40
In case of a non-responding client the MDS fences the client by In case of a non-responding client the MDS fences the client by
issuing a "PERSISTENT RESERVE OUT" command with the service action issuing a "PERSISTENT RESERVE OUT" command with the service action
set to "PREEMPT" or "PREEMPT AND ABORT", the reservation key field set to "PREEMPT" or "PREEMPT AND ABORT", the reservation key field
set to the server's reservation key, the service action reservation set to the server's reservation key, the service action reservation
key field set to the reservation key associated with the non- key field set to the reservation key associated with the non-
responding client, and the type field set to 8h (Exclusive Access - responding client, and the type field set to 8h (Exclusive Access -
Registrants Only). Registrants Only).
After the MDS preempts a client, all client I/O to the LU fails. The After the MDS preempts a client, all client I/O to the LU fails. The
client should at this point return any layout that refers to the client SHOULD at this point return any layout that refers to the
device ID that points to the LU. Note that the client can device ID that points to the LU. Note that the client can
distinguish I/O errors due to fencing from other errors based on the distinguish I/O errors due to fencing from other errors based on the
"RESERVATION CONFLICT" SCSI status. Refer to [SPC4] for details. "RESERVATION CONFLICT" SCSI status. Refer to [SPC4] for details.
2.4.10.5. Client Recovery After a Fence Action 2.4.10.5. Client Recovery After a Fence Action
A client that detects a "RESERVATION CONFLICT" SCSI status (I/O A client that detects a "RESERVATION CONFLICT" SCSI status (I/O
error) on the storage devices MUST commit all layouts that use the error) on the storage devices MUST commit all layouts that use the
storage device through the MDS, return all outstanding layouts for storage device through the MDS, return all outstanding layouts for
the device, forget the device ID and unregister the reservation key. the device, forget the device ID and unregister the reservation key.
Future GETDEVICEINFO calls MAY refer to the storage device again, in
Future GETDEVICEINFO calls may refer to the storage device again, in
which case the client will perform a new registration based on the which case the client will perform a new registration based on the
key provided (via sbv_pr_key) at that time. key provided (via sbv_pr_key) at that time.
2.5. Crash Recovery Issues 2.5. Crash Recovery Issues
A critical requirement in crash recovery is that both the client and A critical requirement in crash recovery is that both the client and
the server know when the other has failed. Additionally, it is the server know when the other has failed. Additionally, it is
required that a client sees a consistent view of data across server required that a client sees a consistent view of data across server
restarts. These requirements and a full discussion of crash recovery restarts. These requirements and a full discussion of crash recovery
issues are covered in the "Crash Recovery" section of the NFSv41 issues are covered in the "Crash Recovery" section of the NFSv41
specification [RFC5661]. This document contains additional crash specification [RFC5661]. This document contains additional crash
recovery material specific only to the SCSI layout. recovery material specific only to the SCSI layout.
When the server crashes while the client holds a writable layout, and When the server crashes while the client holds a writable layout, and
the client has written data to blocks covered by the layout, and the the client has written data to blocks covered by the layout, and the
blocks are still in the PNFS_SCSI_INVALID_DATA state, the client has blocks are still in the PNFS_SCSI_INVALID_DATA state, the client has
two options for recovery. If the data that has been written to these two options for recovery. If the data that has been written to these
blocks is still cached by the client, the client can simply re-write blocks is still cached by the client, the client can simply re-write
the data via NFSv4, once the server has come back online. However, the data via NFSv4, once the server has come back online. However,
if the data is no longer in the client's cache, the client MUST NOT if the data is no longer in the client's cache, the client MUST NOT
attempt to source the data from the data servers. Instead, it should attempt to source the data from the data servers. Instead, it SHOULD
attempt to commit the blocks in question to the server during the attempt to commit the blocks in question to the server during the
server's recovery grace period, by sending a LAYOUTCOMMIT with the server's recovery grace period, by sending a LAYOUTCOMMIT with the
"loca_reclaim" flag set to true. This process is described in detail "loca_reclaim" flag set to true. This process is described in detail
in Section 18.42.4 of [RFC5661]. in Section 18.42.4 of [RFC5661].
2.6. Recalling Resources: CB_RECALL_ANY 2.6. Recalling Resources: CB_RECALL_ANY
The server may decide that it cannot hold all of the state for The server MAY decide that it cannot hold all of the state for
layouts without running out of resources. In such a case, it is free layouts without running out of resources. In such a case, it is free
to recall individual layouts using CB_LAYOUTRECALL to reduce the to recall individual layouts using CB_LAYOUTRECALL to reduce the
load, or it may choose to request that the client return any layout. load, or it MAY choose to request that the client return any layout.
The NFSv4.1 spec [RFC5661] defines the following types: The NFSv4.1 spec [RFC5661] defines the following types:
const RCA4_TYPE_MASK_BLK_LAYOUT = 4; const RCA4_TYPE_MASK_BLK_LAYOUT = 4;
struct CB_RECALL_ANY4args { struct CB_RECALL_ANY4args {
uint32_t craa_objects_to_keep; uint32_t craa_objects_to_keep;
bitmap4 craa_type_mask; bitmap4 craa_type_mask;
}; };
When the server sends a CB_RECALL_ANY request to a client specifying When the server sends a CB_RECALL_ANY request to a client specifying
the RCA4_TYPE_MASK_BLK_LAYOUT bit in craa_type_mask, the client the RCA4_TYPE_MASK_BLK_LAYOUT bit in craa_type_mask, the client
should immediately respond with NFS4_OK, and then asynchronously SHOULD immediately respond with NFS4_OK, and then asynchronously
return complete file layouts until the number of files with layouts return complete file layouts until the number of files with layouts
cached on the client is less than craa_object_to_keep. cached on the client is less than craa_object_to_keep.
2.7. Transient and Permanent Errors 2.7. Transient and Permanent Errors
The server may respond to LAYOUTGET with a variety of error statuses. The server may respond to LAYOUTGET with a variety of error statuses.
These errors can convey transient conditions or more permanent These errors can convey transient conditions or more permanent
conditions that are unlikely to be resolved soon. conditions that are unlikely to be resolved soon.
The error NFS4ERR_RECALLCONFLICT indicates that the server has The error NFS4ERR_RECALLCONFLICT indicates that the server has
recently issued a CB_LAYOUTRECALL to the requesting client, making it recently issued a CB_LAYOUTRECALL to the requesting client, making it
necessary for the client to respond to the recall before processing necessary for the client to respond to the recall before processing
the layout request. A client can wait for that recall to be receive the layout request. A client can wait for that recall to be receive
and processe or it can retry as for NFS4ERR_TRYLATER, as described and processe or it can retry as for NFS4ERR_TRYLATER, as described
below. below.
The error NFS4ERR_TRYLATER is used to indicate that the server cannot The error NFS4ERR_TRYLATER is used to indicate that the server cannot
immediately grant the layout to the client. This may be due to immediately grant the layout to the client. This MAY be due to
constraints on writable sharing of blocks by multiple clients or to a constraints on writable sharing of blocks by multiple clients or to a
conflict with a recallable lock (e.g. a delegation). In either case, conflict with a recallable lock (e.g. a delegation). In either case,
a reasonable approach for the client is to wait several milliseconds a reasonable approach for the client is to wait several milliseconds
and retry the request. The client SHOULD track the number of and retry the request. The client SHOULD track the number of
retries, and if forward progress is not made, the client should retries, and if forward progress is not made, the client SHOULD
abandon the attempt to get a layout and perform READ and WRITE abandon the attempt to get a layout and perform READ and WRITE
operations by sending them to the server operations by sending them to the server
The error NFS4ERR_LAYOUTUNAVAILABLE may be returned by the server if The error NFS4ERR_LAYOUTUNAVAILABLE MAY be returned by the server if
layouts are not supported for the requested file or its containing layouts are not supported for the requested file or its containing
file system. The server may also return this error code if the file system. The server MAY also return this error code if the
server is the progress of migrating the file from secondary storage, server is the progress of migrating the file from secondary storage,
there is a conflicting lock that would prevent the layout from being there is a conflicting lock that would prevent the layout from being
granted, or for any other reason that causes the server to be unable granted, or for any other reason that causes the server to be unable
to supply the layout. As a result of receiving to supply the layout. As a result of receiving
NFS4ERR_LAYOUTUNAVAILABLE, the client should abandon the attempt to NFS4ERR_LAYOUTUNAVAILABLE, the client SHOULD abandon the attempt to
get a layout and perform READ and WRITE operations by sending them to get a layout and perform READ and WRITE operations by sending them to
the MDS. It is expected that a client will not cache the file's the MDS. It is expected that a client will not cache the file's
layoutunavailable state forever. In particular, when the file is layoutunavailable state forever. In particular, when the file is
closed or opened by the client, issuing a new LAYOUTGET is closed or opened by the client, issuing a new LAYOUTGET is
appropriate. appropriate.
2.8. Volatile write caches 2.8. Volatile write caches
Many storage devices implement volatile write caches that require an Many storage devices implement volatile write caches that require an
explicit flush to persist the data from write operations to stable explicit flush to persist the data from write operations to stable
storage. Storage devices implementing [SBC3] should indicate a storage. Storage devices implementing [SBC3] should indicate a
volatile write cache by setting the WCE bit to 1 in the Caching mode volatile write cache by setting the WCE bit to 1 in the Caching mode
page. When a volatile write cache is used, the pNFS server must page. When a volatile write cache is used, the pNFS server MUST
ensure the volatile write cache has been committed to stable storage ensure the volatile write cache has been committed to stable storage
before the LAYOUTCOMMIT operation returns by using one of the before the LAYOUTCOMMIT operation returns by using one of the
SYNCHRONIZE CACHE commands. SYNCHRONIZE CACHE commands.
3. Enforcing NFSv4 Semantics 3. Enforcing NFSv4 Semantics
The functionality provided by SCSI Persistent Reservations makes it The functionality provided by SCSI Persistent Reservations makes it
possible for the MDS to control access by individual client machines possible for the MDS to control access by individual client machines
to specific LUs. Individual client machines may be allowed to or to specific LUs. Individual client machines may be allowed to or
prevented from reading or writing to certain block devices. Finer- prevented from reading or writing to certain block devices. Finer-
skipping to change at page 28, line 41 skipping to change at page 28, line 41
Appendix B. RFC Editor Notes Appendix B. RFC Editor Notes
[RFC Editor: please remove this section prior to publishing this [RFC Editor: please remove this section prior to publishing this
document as an RFC] document as an RFC]
[RFC Editor: prior to publishing this document as an RFC, please [RFC Editor: prior to publishing this document as an RFC, please
replace all occurrences of RFCTBD10 with RFCxxxx where xxxx is the replace all occurrences of RFCTBD10 with RFCxxxx where xxxx is the
RFC number of this document] RFC number of this document]
[RFC Editor: This draft has a normative dependence on SAM-5, whose
publication as a standard is in progress. Publication of this draft
as an RFC has to wait for publication of SAM-5 including availability
of a reference to the published standard. The author will be able to
advise the RFC Editor when SAM-5 is published and supply the
necessary reference.]
Author's Address Author's Address
Christoph Hellwig Christoph Hellwig
Email: hch@lst.de Email: hch@lst.de
 End of changes. 45 change blocks. 
59 lines changed or deleted 71 lines changed or added

This html diff was produced by rfcdiff 1.45. The latest version is available from http://tools.ietf.org/tools/rfcdiff/