draft-ietf-nfsv4-pnfs-block-04.txt   draft-ietf-nfsv4-pnfs-block-05.txt 
NFSv4 Working Group David L. Black NFSv4 Working Group David L. Black
Internet Draft Stephen Fridella Internet Draft Stephen Fridella
Expires: April 2008 Jason Glasgow Expires: May 21, 2008 Jason Glasgow
Intended Status: Proposed Standard EMC Corporation Intended Status: Proposed Standard EMC Corporation
October 3, 2007 November 18, 2007
pNFS Block/Volume Layout pNFS Block/Volume Layout
draft-ietf-nfsv4-pnfs-block-04.txt draft-ietf-nfsv4-pnfs-block-05.txt
Status of this Memo Status of this Memo
By submitting this Internet-Draft, each author represents that By submitting this Internet-Draft, each author represents that
any applicable patent or other IPR claims of which he or she is any applicable patent or other IPR claims of which he or she is
aware have been or will be disclosed, and any of which he or she aware have been or will be disclosed, and any of which he or she
becomes aware will be disclosed, in accordance with Section 6 of becomes aware will be disclosed, in accordance with Section 6 of
BCP 79. BCP 79.
Internet-Drafts are working documents of the Internet Engineering Internet-Drafts are working documents of the Internet Engineering
skipping to change at page 2, line 15 skipping to change at page 2, line 15
based storage. based storage.
Conventions used in this document Conventions used in this document
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this "SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in RFC-2119 [RFC2119]. document are to be interpreted as described in RFC-2119 [RFC2119].
Table of Contents Table of Contents
1. Introduction........................................... 3 1. Introduction...................................................3
2. Block Layout Description ................................ 3 1.1. General Definitions.......................................3
2.1. Background and Architecture ......................... 3 2. Block Layout Description.......................................4
2.2. GETDEVICELIST and GETDEVICEINFO...................... 4 2.1. Background and Architecture...............................4
2.2.1. Volume Identification.......................... 4 2.2. GETDEVICELIST and GETDEVICEINFO...........................5
2.2.2. Volume Topology................................ 5 2.2.1. Volume Identification................................5
2.2.3. GETDEVICELIST and GETDEVICEINFO deviceid4......... 8 2.2.2. Volume Topology......................................6
2.3. Data Structures: Extents and Extent Lists............. 9 2.2.3. GETDEVICELIST and GETDEVICEINFO deviceid4............9
2.3.1. Layout Requests and Extent Lists.................11 2.3. Data Structures: Extents and Extent Lists.................9
2.3.2. Layout Commits ................................11 2.3.1. Layout Requests and Extent Lists....................12
2.3.3. Layout Returns ................................12 2.3.2. Layout Commits......................................13
2.3.4. Client Copy-on-Write Processing..................13 2.3.3. Layout Returns......................................13
2.3.5. Extents are Permissions.........................14 2.3.4. Client Copy-on-Write Processing.....................14
2.3.6. End-of-file Processing .........................15 2.3.5. Extents are Permissions.............................15
2.3.7. Client Fencing ................................16 2.3.6. End-of-file Processing..............................17
2.4. Crash Recovery Issues...............................18 2.3.7. Layout Hints........................................17
2.5. Recalling resources: CB_RECALL_ANY ...................18 2.3.8. Client Fencing......................................18
2.6. Transient and Permanent Errors.......................19 2.4. Crash Recovery Issues....................................20
3. Security Considerations.................................19 2.5. Recalling resources: CB_RECALL_ANY.......................20
4. Conclusions............................................21 2.6. Transient and Permanent Errors...........................21
5. IANA Considerations.....................................21 3. Security Considerations.......................................21
6. Revision History .......................................21 4. Conclusions...................................................23
7. Acknowledgments........................................22 5. IANA Considerations...........................................23
8. References.............................................23 6. Acknowledgments...............................................23
8.1. Normative References................................23 7. References....................................................23
8.2. Informative References..............................23 7.1. Normative References.....................................23
Author's Addresses........................................23 7.2. Informative References...................................24
Intellectual Property Statement.............................24 Author's Addresses...............................................24
Disclaimer of Validity.....................................24 Intellectual Property Statement..................................25
Copyright Statement .......................................25 Disclaimer of Validity...........................................25
Acknowledgment............................................25 Copyright Statement..............................................25
Acknowledgment...................................................25
1. Introduction 1. Introduction
Figure 1 shows the overall architecture of a pNFS system: Figure 1 shows the overall architecture of a pNFS system:
+-----------+ +-----------+
|+-----------+ +-----------+ |+-----------+ +-----------+
||+-----------+ | | ||+-----------+ | |
||| | NFSv4 + pNFS | | ||| | NFSv4.1 + pNFS | |
+|| Clients |<------------------------------>| Server | +|| Clients |<------------------------------>| Server |
+| | | | +| | | |
+-----------+ | | +-----------+ | |
||| +-----------+ ||| +-----------+
||| | ||| |
||| | ||| |
||| +-----------+ | ||| +-----------+ |
||| |+-----------+ | ||| |+-----------+ |
||+----------------||+-----------+ | ||+----------------||+-----------+ |
|+-----------------||| | | |+-----------------||| | |
skipping to change at page 3, line 35 skipping to change at page 3, line 35
+-----------+ +-----------+
Figure 1 pNFS Architecture Figure 1 pNFS Architecture
The overall approach is that pNFS-enhanced clients obtain sufficient The overall approach is that pNFS-enhanced clients obtain sufficient
information from the server to enable them to access the underlying information from the server to enable them to access the underlying
storage (on the Storage Systems) directly. See the pNFS portion of storage (on the Storage Systems) directly. See the pNFS portion of
[NFSV4.1] for more details. This draft is concerned with access from [NFSV4.1] for more details. This draft is concerned with access from
pNFS clients to Storage Systems over storage protocols based on pNFS clients to Storage Systems over storage protocols based on
blocks and volumes, such as the SCSI protocol family (e.g., parallel blocks and volumes, such as the SCSI protocol family (e.g., parallel
SCSI, FCP for Fibre Channel, iSCSI, SAS). This class of storage is SCSI, FCP for Fibre Channel, iSCSI, SAS, and FCoE). This class of
referred to as block/volume storage. While the Server to Storage storage is referred to as block/volume storage. While the Server to
System protocol is not of concern for interoperability here, it will Storage System protocol is not of concern for interoperability here,
typically also be a block/volume protocol when clients use block/ it will typically also be a block/volume protocol when clients use
volume protocols. block/ volume protocols.
1.1. General Definitions
The following definitions are provided for the purpose of providing
an appropriate context for the reader.
Byte
This document defines a byte as an octet, i.e. a datum exactly 8
bits in length.
Client
The "client" is the entity that accesses the NFS server's
resources. The client may be an application which contains the
logic to access the NFS server directly. The client may also be
the traditional operating system client that provides remote file
system services for a set of applications.
Server
The "Server" is the entity responsible for coordinating client
access to a set of file systems and is identified by a Server
owner.
2. Block Layout Description 2. Block Layout Description
2.1. Background and Architecture 2.1. Background and Architecture
The fundamental storage abstraction supported by block/volume storage The fundamental storage abstraction supported by block/volume storage
is a storage volume consisting of a sequential series of fixed size is a storage volume consisting of a sequential series of fixed size
blocks. This can be thought of as a logical disk; it may be realized blocks. This can be thought of as a logical disk; it may be realized
by the Storage System as a physical disk, a portion of a physical by the Storage System as a physical disk, a portion of a physical
disk or something more complex (e.g., concatenation, striping, RAID, disk or something more complex (e.g., concatenation, striping, RAID,
and combinations thereof) involving multiple physical disks or and combinations thereof) involving multiple physical disks or
portions thereof. portions thereof.
A pNFS layout for this block/volume class of storage is responsible A pNFS layout for this block/volume class of storage is responsible
for mapping from an NFS file (or portion of a file) to the blocks of for mapping from an NFS file (or portion of a file) to the blocks of
storage volumes that contain the file. The blocks are expressed as storage volumes that contain the file. The blocks are expressed as
extents with 64 bit offsets and lengths using the existing NFSv4 extents with 64 bit offsets and lengths using the existing NFSv4
offset4 and length4 types. Clients must be able to perform I/O to offset4 and length4 types. Clients must be able to perform I/O to
the block extents without affecting additional areas of storage the block extents without affecting additional areas of storage
(especially important for writes), therefore extents MUST be aligned (especially important for writes), therefore extents MUST be aligned
to 512-octet boundaries, and SHOULD be aligned to the block size used to 512-byte boundaries, and SHOULD be aligned to the block size used
by the NFSv4 server in managing the actual filesystem (4 kilobytes by the NFSv4 server in managing the actual filesystem (4 kilobytes
and 8 kilobytes are common block sizes). This block size is and 8 kilobytes are common block sizes). This block size is
available as the NFSv4.1 layout_blksize attribute. [NFSV4.1] available as the NFSv4.1 layout_blksize attribute. [NFSV4.1]
The pNFS operation for requesting a layout (LAYOUTGET) includes the The pNFS operation for requesting a layout (LAYOUTGET) includes the
"layoutiomode4 loga_iomode" argument which indicates whether the "layoutiomode4 loga_iomode" argument which indicates whether the
requested layout is for read-only use or read-write use. A read-only requested layout is for read-only use or read-write use. A read-only
layout may contain holes that are read as zero, whereas a read-write layout may contain holes that are read as zero, whereas a read-write
layout will contain allocated, but un-initialized storage in those layout will contain allocated, but un-initialized storage in those
holes (read as zero, can be written by client). This draft also holes (read as zero, can be written by client). This draft also
supports client participation in copy on write by providing both supports client participation in copy on write (e.g. for file systems
read-only and un-initialized storage for the same range in a layout. with snapshots) by providing both read-only and un-initialized
Reads are initially performed on the read-only storage, with writes storage for the same range in a layout. Reads are initially
going to the un-initialized storage. After the first write that performed on the read-only storage, with writes going to the un-
initializes the un-initialized storage, all reads are performed to initialized storage. After the first write that initializes the un-
that now-initialized writeable storage, and the corresponding read- initialized storage, all reads are performed to that now-initialized
only storage is no longer used. writeable storage, and the corresponding read-only storage is no
longer used.
2.2. GETDEVICELIST and GETDEVICEINFO 2.2. GETDEVICELIST and GETDEVICEINFO
2.2.1. Volume Identification 2.2.1. Volume Identification
Storage Systems such as storage arrays can have multiple physical Storage Systems 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
the same storage volumes via different ports on different networks. the same storage volumes via different ports on different networks.
The networks may not even be the same technology - for example, The networks may not even be the same technology - for example,
skipping to change at page 5, line 7 skipping to change at page 5, line 33
possible, hence network address are difficult to use for volume possible, hence network address are difficult to use for volume
identification. For this reason, this pNFS block layout identifies identification. For this reason, this pNFS block layout identifies
storage volumes by content, for example providing the means to match storage volumes by content, for example providing the means to match
(unique portions of) labels used by volume managers. Any block pNFS (unique portions of) labels used by volume managers. Any block pNFS
system using this layout MUST support a means of content-based unique system using this layout MUST support a means of content-based unique
volume identification that can be employed via the data structure volume identification that can be employed via the data structure
given here. given here.
struct pnfs_block_sig_component4 { /* disk signature component */ struct pnfs_block_sig_component4 { /* disk signature component */
offset4 sig_offset; /* octet offset of component int64_t sig_offset; /* byte offset of component on
within signature block */ volume*/
opaque contents<>; /* contents of this component of the opaque contents<>; /* contents of this component of
signature (this is opaque) */ the signature (this is
opaque) */
}; };
Note that the opaque "contents" field in the Note that the opaque "contents" field in the
"pnfs_block_sig_component4" structure MUST NOT be interpreted as a "pnfs_block_sig_component4" structure MUST NOT be interpreted as a
zero-terminated string, as it may contain embedded zero-valued zero-terminated string, as it may contain embedded zero-valued bytes.
octets. There are no restrictions on alignment (e.g., neither There are no restrictions on alignment (e.g., neither sig_offset nor
sig_offset nor the length are required to be multiples of 4). The the length are required to be multiples of 4). The sig_offset is a
sig_offset represents an offset from the start of a signature block signed quantity which when positive represents an byte offset from
(defined below). the start of the volume, and when negative represents an byte offset
from the end of the volume.
Negative offsets are permitted in order to simplify the client
implementation on systems where the device label is found at a fixed
offset from the end of the volume. If the server uses negative
offsets to describe the signature, then the client and server MUST
NOT see different volume sizes. Negative offsets SHOULD NOT be used
in systems that dynamically resize volumes unless care is taken to
ensure that the device label is always present at the offset from the
end of the volume as seen by the clients.
A signature is an array up to "PNFS_BLOCK_MAX_SIG_COMP" (defined
below) signature components. The client MUST NOT assume that all
signature components are colocated within a single sector on a block
device.
The pNFS client block layout driver uses this volume identification The pNFS client block layout driver uses this volume identification
to map pnfs_block_volume_type4 VOLUME_SIMPLE deviceid4s to its local to map pnfs_block_volume_type4 PNFS_BLOCK_VOLUME_SIMPLE deviceid4s to
view of a LUN. its local view of a LUN.
2.2.2. Volume Topology 2.2.2. Volume Topology
The pNFS block server volume topology is expressed as an arbitrary The pNFS block server volume topology is expressed as an arbitrary
combination of base volume types enumerated in the following data combination of base volume types enumerated in the following data
structures. structures.
enum pnfs_block_volume_type4 { enum pnfs_block_volume_type4 {
VOLUME_SIMPLE = 0, /* volume maps to a single LU */ PNFS_BLOCK_VOLUME_SIMPLE = 0, /* volume maps to a single LU */
VOLUME_SLICE = 1, /* volume is a slice of another volume */ PNFS_BLOCK_VOLUME_SLICE = 1, /* volume is a slice of another
volume */
VOLUME_CONCAT = 2, /* volume is a concatenation of multiple PNFS_BLOCK_VOLUME_CONCAT = 2, /* volume is a concatenation of
volumes */ multiple volumes */
VOLUME_STRIPE = 3 /* volume is striped across multiple PNFS_BLOCK_VOLUME_STRIPE = 3 /* volume is striped across
volumes */ multiple volumes */
}; };
const PNFS_BLOCK_MAX_SIG_COMP = 16; /* maximum components per
signature */
struct pnfs_block_simple_volume_info4 { struct pnfs_block_simple_volume_info4 {
deviceid4 vol_id; /* this volume id */ deviceid4 vol_id; /* this volume id */
pnfs_block_sig_component4 ds<PNFS_BLOCK_MAX_SIG_COMP>;
int64_t sig_offset; /* offset in 512 octet blocks
from start of volume if positive
from end of volume if negative
pnfs_block_sig_component4 ds<MAX_SIG_COMP>;
/* disk signature */ /* disk signature */
}; };
struct pnfs_block_slice_volume_info4 { struct pnfs_block_slice_volume_info4 {
deviceid4 vol_id; /* this volume id */ deviceid4 vol_id; /* this volume id */
offset4 start; /* offset of the start of the offset4 start; /* offset of the start of the
slice in 512 octet blocks */ slice in bytes */
length4 length; /* length of slice in 512 octet blocks length4 length; /* length of slice in bytes */
*/
deviceid4 volume; /* volume which is sliced */ deviceid4 volume; /* volume which is sliced */
}; };
struct pnfs_block_concat_volume_info4 { struct pnfs_block_concat_volume_info4 {
deviceid4 vol_id; /* this volume id */ deviceid4 vol_id; /* this volume id */
deviceid4 volumes<>; /* volumes which are concatenated */ deviceid4 volumes<>; /* volumes which are
concatenated */
}; };
struct pnfs_block_stripe_volume_info4 { struct pnfs_block_stripe_volume_info4 {
deviceid4 vol_id; /* this volume id */ deviceid4 vol_id; /* this volume id */
length4 stripe_unit; /* size of stripe in 512 octect length4 stripe_unit; /* size of stripe in octects */
blocks */
deviceid4 volumes<>; /* volumes which are striped deviceid4 volumes<>; /* volumes which are striped
across -- MUST be same size */ across -- MUST be same size
}; */
};
union pnfs_block_volume4 switch (pnfs_block_volume_type4 type) { union pnfs_block_volume4 switch (pnfs_block_volume_type4 type) {
case VOLUME_SIMPLE: case PNFS_BLOCK_VOLUME_SIMPLE:
pnfs_block_simple_volume_info4 simple_info; pnfs_block_simple_volume_info4 simple_info;
case VOLUME_SLICE: case PNFS_BLOCK_VOLUME_SLICE:
pnfs_block_slice_volume_info4 slice_info; pnfs_block_slice_volume_info4 slice_info;
case VOLUME_CONCAT: case PNFS_BLOCK_VOLUME_CONCAT:
pnfs_block_concat_volume_info4 concat_info; pnfs_block_concat_volume_info4 concat_info;
case VOLUME_STRIPE: case PNFS_BLOCK_VOLUME_STRIPE:
pnfs_block_stripe_volume_info4 stripe_info; pnfs_block_stripe_volume_info4 stripe_info;
}; };
struct pnfs_block_deviceaddr4 { struct pnfs_block_deviceaddr4 {
pnfs_block_volume4 volumes<>; /* array of volumes */ pnfs_block_volume4 volumes<>; /* array of volumes */
}; };
The "pnfs_block_deviceaddr4" data structure is a structure that The "pnfs_block_deviceaddr4" data structure is a structure that
allows arbitrarily complex nested volume structures to be encoded. allows arbitrarily complex nested volume structures to be encoded.
The types of aggregations that are allowed are stripes, The types of aggregations that are allowed are stripes,
concatenations, and slices. Note that the volume topology expressed concatenations, and slices. Note that the volume topology expressed
in the pnfs_block_deviceaddr4 data structure will always resolve to a in the pnfs_block_deviceaddr4 data structure will always resolve to a
set of pnfs_block_volume_type4 VOLUME_SIMPLE. The array of volumes set of pnfs_block_volume_type4 PNFS_BLOCK_VOLUME_SIMPLE. The array
is ordered such that the root volume is the last element of the of volumes is ordered such that the root volume is the last element
array. Concat, slice and stripe volumes MUST refer to volumes of the array. Concat, slice and stripe volumes MUST refer to volumes
defined by lower indexed elements of the array. defined by lower indexed elements of the array.
The "pnfs_block_device_addr4" data structure is returned by the The "pnfs_block_device_addr4" data structure is returned by the
server as the storage-protocol-specific opaque field da_addr_body in server as the storage-protocol-specific opaque field da_addr_body in
the "device_addr4" structure by successful GETDEVICELIST and the "device_addr4" structure by successful GETDEVICELIST and
GETDEVICEINFO operations. [NFSV4.1]. Typically the server in GETDEVICEINFO operations. [NFSV4.1]. Typically the server in
response to a GETDEVICELIST request will return a single response to a GETDEVICELIST request will return a single
"devlist_item4" in the gdlr_devinfo_list array. This is because the "devlist_item4" in the gdlr_devinfo_list array. This is because the
"opaque da_addr_body" field inside the "device_addr4" encodes the "opaque da_addr_body" field inside the "device_addr4" encodes the
entire volume hierarchy. In the case of copy-on-write file systems, entire volume hierarchy. In the case of copy-on-write file systems,
the "gdlr_devinfo_list" array will contain two devices_item4s, one the "gdlr_devinfo_list" array will contain two devices_item4's, one
describing the read-only volume hierarchy, and one describing the describing the read-only volume hierarchy, and one describing the
writable volume hierarchy. writable volume hierarchy. There is no required ordering of the
readable and writable volumes in the array as the volumes are
uniquely identified by their deviceid4, and are referred to by
layouts using the deviceid4. Another example of the server returning
multiple device items occurs when the file handle represents the root
of a name space spanning multiple physical file systems on the
server, each with a different volume hierarchy.
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_block_volume_type4 VOLUME_SIMPLE" These set of volumes of type PNFS_BLOCK_VOLUME_SIMPLE. These volumes are
volumes are each uniquely identified by a set of signature components each uniquely identified by a set of signature components.
located within respective signature blocks. Each VOLUME_SIMPLE Complicated volume hierarchies may be composed of dozens of volumes
volume specifies the location of its signature block in terms of 512 each with several signature components, thus the device address may
octet blocks. The "int64_t sig_offset" is a signed quantity which require several kilobytes. The client SHOULD be prepared to allocate
when positive represents an offset from the start of the volume, and a large buffer to contain the result, and in the case of the server
when negative represents an offset from the end of the volume. returning NFS4ERR_TOOSMALL the client SHOULD be prepared to allocate
a large enough buffer to contain the expected result.
Negative offsets are permitted in order to simplify the client
implementation on systems where the device label is found at a fixed
offset from the end of the volume. If the server uses negative
offsets to describe the signature, then the client and server MUST
NOT see different volume sizes. Negative offsets SHOULD NOT be used
in systems that dynamically resize volumes unless care is taken to
ensure that the device label is always present at the offset from the
end of the volume as seen by the clients.
2.2.3. GETDEVICELIST and GETDEVICEINFO deviceid4 2.2.3. GETDEVICELIST and GETDEVICEINFO deviceid4
The "deviceid4 dli_id" returned in the devlist_item4 of a successful The "deviceid4 dli_id" returned in the devlist_item4 of a successful
GETDEVICELIST operation is a shorthand id used to reference the whole GETDEVICELIST operation is a shorthand id used to reference the whole
volume topology. Decoding the "pnfs_block_deviceaddr4" results in a volume topology. Decoding the "pnfs_block_deviceaddr4" results in a
flat ordering of 512 octet data blocks mapped to VOLUME_SIMPLE flat ordering of data blocks mapped to PNFS_BLOCK_VOLUME_SIMPLE
deviceid4s. Combined with the deviceid4 mapping to a client LUN deviceid4s. Combined with the deviceid4 mapping to a client LUN
described in 2.2.1 Volume Identification, a logical volume offset described in 2.2.1 Volume Identification, a logical volume offset can
can be mapped to a 512 block on a pNFS client LUN. [NFSV4.1] With be mapped to a block on a pNFS client LUN. [NFSV4.1] With the
the exception of the root volume id, the device ids returned in the exception of the root volume id, the device ids returned in the
volumes array of a pnfs_block_deviceaddr4 data structure should not volumes array of a pnfs_block_deviceaddr4 data structure should not
be passed as arguments in a GETDEVICEINFO request. These non-root be passed as arguments in a GETDEVICEINFO request. These non-root
volume device ids are never returned by LAYOUTGET in the volume device ids are never returned by LAYOUTGET in the
"pnfs_block_layout4 vol_id" field. If a non-root device id is passed "pnfs_block_layout4 vol_id" field. If a non-root device id is passed
as an argument in a GETDEVICEINFO request, the server SHOULD return as an argument in a GETDEVICEINFO request, the server SHOULD return
NFS4ERR_INVAL. NFS4ERR_INVAL.
2.3. Data Structures: Extents and Extent Lists 2.3. Data Structures: Extents and Extent Lists
A pNFS block layout is a list of extents within a flat array of 512- A pNFS block layout is a list of extents within a flat array of data
octet data blocks in a logical volume. The details of the volume blocks in a logical volume. The details of the volume topology can
topology can be determined by using the GETDEVICEINFO or be determined by using the GETDEVICEINFO or GETDEVICELIST operation
GETDEVICELIST operation (see discussion of volume identification, (see discussion of volume identification, section 2.2 above). The
section 2.2 above). The block layout describes the individual block block layout describes the individual block extents on the volume
extents on the volume that make up the file. The offsets and length that make up the file. The offsets and length contained in an extent
contained in an extent are specified in units of octets. are specified in units of bytes.
enum pnfs_block_extent_state4 { enum pnfs_block_extent_state4 {
READ_WRITE_DATA = 0, /* the data located by this extent is valid PNFS_BLOCK_READWRITE_DATA = 0, /* the data located by this
extent is valid
for reading and writing. */ for reading and writing. */
READ_DATA = 1, /* the data located by this extent is valid PNFS_BLOCK_READ_DATA = 1, /* the data located by this
for reading only; it may not be written. extent is valid for reading
only; it may not be written.
*/ */
INVALID_DATA = 2, /* the location is valid; the data is PNFS_BLOCK_INVALID_DATA = 2, /* the location is valid; the
invalid. It is a newly (pre-) allocated data is invalid. It is a
extent. There is physical space on the newly (pre-) allocated
volume. */ extent. There is physical
space on the volume. */
NONE_DATA = 3 /* the location is invalid. It is a hole in PNFS_BLOCK_NONE_DATA = 3 /* the location is invalid. It
the file. There is no physical space on is a hole in the file. There
the volume. */ is no physical space on the
volume. */
}; };
struct pnfs_block_extent4 { struct pnfs_block_extent4 {
offset4 file_offset; /* the starting octet offset in deviceid4 vol_id; /* id of logical volume on which
extent of file is stored. */
offset4 file_offset; /* the starting byte offset in
the file */ the file */
length4 extent_length; /* the size in octets of the length4 extent_length; /* the size in bytes of the
extent */ extent */
offset4 storage_offset; /* the starting octet offset in offset4 storage_offset; /* the starting byte offset in
the volume */ the volume */
pnfs_block_extent_state4 es; /* the state of this extent */ pnfs_block_extent_state4 es; /* the state of this extent */
}; };
struct pnfs_block_layout4 { struct pnfs_block_layout4 {
deviceid4 vol_id; /* id of logical volume on which
file is stored. */
pnfs_block_extent4 extents<>; /* extents which make up this pnfs_block_extent4 extents<>; /* extents which make up this
layout. */ layout. */
}; };
The block layout consists of a deviceid4, shorthand for the whole The block layout consists of a list of extents which map the logical
topology of the logical volume on which the file is stored, followed regions of the file to physical locations on a volume. The "storage
by a list of extents which map the logical regions of the file to offset" field within each extent identifies a location on the logical
physical locations on the volume. The "storage offset" field within volume specified by the "vol_id" field in the extent. The vol_id
each extent identifies a location on the logical volume described by itself is shorthand for the whole topology of the logical volume on
the "volume" field in the layout. The client is responsible for which the file is stored. The client is responsible for translating
translating this logical offset into an offset on the appropriate this logical offset into an offset on the appropriate underlying SAN
underlying SAN logical unit. logical unit. In most cases all extents in a layout will reside on
the same volume and thus have the same vol_id. In the case of copy
on write file systems, the PNFS_BLOCK_READ_DATA extents may have a
different vol_id from the writable extents.
Each extent maps a logical region of the file onto a portion of the Each extent maps a logical region of the file onto a portion of the
specified logical volume. The file_offset, extent_length, and es specified logical volume. The file_offset, extent_length, and es
fields for an extent returned from the server are always valid. The fields for an extent returned from the server are always valid. The
interpretation of the storage_offset field depends on the value of es interpretation of the storage_offset field depends on the value of es
as follows (in increasing order): as follows (in increasing order):
o READ_WRITE_DATA means that storage_offset is valid, and points to o PNFS_BLOCK_READ_WRITE_DATA means that storage_offset is valid, and
valid/initialized data that can be read and written. points to valid/initialized data that can be read and written.
o READ_DATA means that storage_offset is valid and points to valid/ o PNFS_BLOCK_READ_DATA means that storage_offset is valid and points
initialized data which can only be read. Write operations are to valid/ initialized data which can only be read. Write
prohibited; the client may need to request a read-write layout. operations are prohibited; the client may need to request a read-
write layout.
o INVALID_DATA means that storage_offset is valid, but points to o PNFS_BLOCK_INVALID_DATA means that storage_offset is valid, but
invalid un-initialized data. This data must not be physically read points to invalid un-initialized data. This data must not be
from the disk until it has been initialized. A read request for physically read from the disk until it has been initialized. A
an INVALID_DATA extent must fill the user buffer with zeros. Write read request for a PNFS_BLOCK_INVALID_DATA extent must fill the
requests must write whole server-sized blocks to the disk; octets user buffer with zeros. Write requests must write whole server-
not initialized by the user must be set to zero. Any write to sized blocks to the disk; bytes not initialized by the user must
storage in an INVALID_DATA extent changes the written portion of be set to zero. Any write to storage in a PNFS_BLOCK_INVALID_DATA
the extent to READ_WRITE_DATA; the pNFS client is responsible for extent changes the written portion of the extent to
PNFS_BLOCK_READ_WRITE_DATA; the pNFS client is responsible for
reporting this change via LAYOUTCOMMIT. reporting this change via LAYOUTCOMMIT.
o NONE_DATA means that storage_offset is not valid, and this extent o PNFS_BLOCK_NONE_DATA means that storage_offset is not valid, and
may not be used to satisfy write requests. Read requests may be this extent may not be used to satisfy write requests. Read
satisfied by zero-filling as for INVALID_DATA. NONE_DATA extents requests may be satisfied by zero-filling as for
may be returned by requests for readable extents; they are never PNFS_BLOCK_INVALID_DATA. PNFS_BLOCK_NONE_DATA extents may be
returned if the request was for a writeable extent. returned by requests for readable extents; they are never returned
if the request was for a writeable extent.
An extent list lists all relevant extents in increasing order of the An extent list lists all relevant extents in increasing order of the
file_offset of each extent; any ties are broken by increasing order file_offset of each extent; any ties are broken by increasing order
of the extent state (es). of the extent state (es).
2.3.1. Layout Requests and Extent Lists 2.3.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 writeable) layout returns only o A request for a readable (but not writeable) layout returns only
READ_DATA or NONE_DATA extents (but not INVALID_DATA or PNFS_BLOCK_READ_DATA or PNFS_BLOCK_NONE_DATA extents (but not
READ_WRITE_DATA extents). PNFS_BLOCK_INVALID_DATA or PNFS_BLOCK_READ_WRITE_DATA extents).
o A request for a writeable layout returns READ_WRITE_DATA or o A request for a writeable layout returns
INVALID_DATA extents (but not NONE_DATA extents). It may also PNFS_BLOCK_READ_WRITE_DATA or PNFS_BLOCK_INVALID_DATA extents (but
return READ_DATA extents only when the offset ranges in those not PNFS_BLOCK_NONE_DATA extents). It may also return
extents are also covered by INVALID_DATA extents to permit writes. PNFS_BLOCK_READ_DATA extents only when the offset ranges in those
extents are also covered by PNFS_BLOCK_INVALID_DATA extents to
permit writes.
o The first extent in the list MUST contain the starting offset. o The first extent in the list MUST contain the starting offset.
o The total size of extents in the extent list MUST cover at least o The total size of extents in the extent list MUST cover at least
the minimum size and no more than the desired size. One exception the minimum size. One exception is allowed: the total size MAY be
is allowed: the total size MAY be smaller if only readable extents smaller if only readable extents were requested and EOF is
were requested and EOF is encountered. encountered.
o Extents in the extent list MUST be logically contiguous for a o Extents in the extent list MUST be logically contiguous for a
read-only layout. For a read-write layout, the set of writable read-only layout. For a read-write layout, the set of writable
extents (i.e., excluding READ_DATA extents) MUST be logically extents (i.e., excluding PNFS_BLOCK_READ_DATA extents) MUST be
contiguous. Every READ_DATA extent in a read-write layout MUST be logically contiguous. Every PNFS_BLOCK_READ_DATA extent in a
covered by an INVALID_DATA extent. This overlap of READ_DATA and read-write layout MUST be covered by a PNFS_BLOCK_INVALID_DATA
INVALID_DATA extents is the only permitted extent overlap. extent. This overlap of PNFS_BLOCK_READ_DATA and
PNFS_BLOCK_INVALID_DATA extents is the only permitted extent
overlap.
o Extents MUST be ordered in the list by starting offset, with o Extents MUST be ordered in the list by starting offset, with
READ_DATA extents preceding INVALID_DATA extents in the case of PNFS_BLOCK_READ_DATA extents preceding PNFS_BLOCK_INVALID_DATA
equal file_offsets. extents in the case of equal file_offsets.
2.3.2. Layout Commits 2.3.2. Layout Commits
struct pnfs_block_layoutupdate4 { struct pnfs_block_layoutupdate4 {
pnfs_block_extent4 commit_list<>;/* list of extents to which now pnfs_block_extent4 commit_list<>; /* list of extents which now
contain valid data. */ contain valid data. */
bool make_version; /* client requests server to
create copy-on-write image of
this file. */
}; };
The "pnfs_block_layoutupdate4" structure is used by the client as the The "pnfs_block_layoutupdate4" structure is used by the client as the
block-protocol specific argument in a LAYOUTCOMMIT operation. The block-protocol specific argument in a LAYOUTCOMMIT operation. The
"commit_list" field is an extent list covering regions of the file "commit_list" field is an extent list covering regions of the file
layout that were previously in the INVALID_DATA state, but have been layout that were previously in the PNFS_BLOCK_INVALID_DATA state, but
written by the client and should now be considered in the have been written by the client and should now be considered in the
READ_WRITE_DATA state. The es field of each extent in the PNFS_BLOCK_READ_WRITE_DATA state. The es field of each extent in the
commit_list MUST be set to READ_WRITE_DATA. Implementers should be commit_list MUST be set to PNFS_BLOCK_READ_WRITE_DATA. Implementers
aware that a server may be unable to commit regions at a granularity should be aware that a server may be unable to commit regions at a
smaller than a file-system block (typically 4KB or 8KB). As noted granularity smaller than a file-system block (typically 4KB or 8KB).
above, the block-size that the server uses is available as an NFSv4 As noted above, the block-size that the server uses is available as
attribute, and any extents included in the "commit_list" MUST be an NFSv4 attribute, and any extents included in the "commit_list"
aligned to this granularity and have a size that is a multiple of MUST be aligned to this granularity and have a size that is a
this granularity. If the client believes that its actions have moved multiple of this granularity. If the client believes that its
the end-of-file into the middle of a block being committed, the actions have moved the end-of-file into the middle of a block being
client MUST write zeroes from the end-of-file to the end of that committed, the client MUST write zeroes from the end-of-file to the
block before committing the block. Failure to do so may result in end of that block before committing the block. Failure to do so may
junk (uninitialized data) appearing in that area if the file is result in junk (uninitialized data) appearing in that area if the
subsequently extended by moving the end-of-file. file is subsequently extended by moving the end-of-file.
The "make_version" field of the structure is a flag that the client
may set to request that the server create a copy-on-write image of
the file (pNFS clients may be involved in this operation - see
section 2.2.4, below). In anticipation of this operation the client
which sets the "make_version" flag in the LAYOUTCOMMIT operation
should immediately mark all extents in the layout that is possesses
as state READ_DATA. Future writes to the file require a new
LAYOUTGET operation to the server with an "iomode" set to
LAYOUTIOMODE_RW.
2.3.3. Layout Returns 2.3.3. Layout Returns
struct pnfs_block_layoutreturn4 { The LAYOUTRETURN operation is done without any block layout specific
data. When the LAYOUTRETURN operation specifies a
pnfs_block_extent4 rel_list<>; /* list of extents the client LAYOUTRETURN4_FILE_return type, then the layoutreturn_file4 data
will no longer use. */ structure specifies the region of the file layout that is no longer
needed by the client. The opaque "lrf_body" field of the
}; "layoutreturn_file4" data structure MUST have length zero. A
LAYOUTRETURN operation represents an explicit release of resources by
The "rel_list" field is an extent list covering regions of the file the client, usually done for the purpose of avoiding unnecessary
layout that are no longer needed by the client. Including extents in CB_LAYOUTRECALL operations in the future. The client may return
the "rel_list" for a LAYOUTRETURN operation represents an explicit disjoint regions of the file by using multiple LAYOUTRETURN
release of resources by the client, usually done for the purpose of operations within a single COMPOUND operation.
avoiding unnecessary CB_LAYOUTRECALL operations in the future.
Note that the block/volume layout supports unilateral layout Note that the block/volume layout supports unilateral layout
revocation. When a layout is unilaterally revoked by the server, revocation. When a layout is unilaterally revoked by the server,
usually due to the client's lease timer expiring or the client usually due to the client's lease time expiring, or a delegation
failing to return a layout in a timely manner, it is important for being recalled, or the client failing to return a layout in a timely
the sake of correctness that any in-flight I/Os that the client manner, it is important for the sake of correctness that any in-
issued before the layout was revoked are rejected at the storage. flight I/Os that the client issued before the layout was revoked are
For the block/volume protocol, this is possible by fencing a client rejected at the storage. For the block/volume protocol, this is
with an expired layout timer from the physical storage. Note, possible by fencing a client with an expired layout timer from the
however, that the granularity of this operation can only be at the physical storage. Note, however, that the granularity of this
host/logical-unit level. Thus, if one of a client's layouts is operation can only be at the host/logical-unit level. Thus, if one
unilaterally revoked by the server, it will effectively render of a client's layouts is unilaterally revoked by the server, it will
useless *all* of the client's layouts for files located on the effectively render useless *all* of the client's layouts for files
storage units comprising the logical volume. This may render useless located on the storage units comprising the logical volume. This may
the client's layouts for files in other filesystems. render useless the client's layouts for files in other file systems.
2.3.4. Client Copy-on-Write Processing 2.3.4. Client Copy-on-Write Processing
Distinguishing the READ_WRITE_DATA and READ_DATA extent types in Copy-on-write is a mechanism used to support file and/or file system
combination with the allowed overlap of READ_DATA extents with snapshots. When writing to unaligned regions, or to regions smaller
INVALID_DATA extents allows copy-on-write processing to be done by than a file system block, the writer must copy the portions of the
pNFS clients. In classic NFS, this operation would be done by the original file data to a new location on disk. This behavior can
server. Since pNFS enables clients to do direct block access, it is either be implemented on the client or the server. The paragraphs
useful for clients to participate in copy-on-write operations. All below describe how a pNFS block layout client implements access to a
block/volume pNFS clients MUST support this copy-on-write processing. file which requires copy-on-write semantics.
When a client wishes to write data covered by a READ_DATA extent, it Distinguishing the PNFS_BLOCK_READ_WRITE_DATA and
MUST have requested a writable layout from the server; that layout PNFS_BLOCK_READ_DATA extent types in combination with the allowed
will contain INVALID_DATA extents to cover all the data ranges of overlap of PNFS_BLOCK_READ_DATA extents with PNFS_BLOCK_INVALID_DATA
that layout's READ_DATA extents. More precisely, for any file_offset extents allows copy-on-write processing to be done by pNFS clients.
range covered by one or more READ_DATA extents in a writable layout, In classic NFS, this operation would be done by the server. Since
the server MUST include one or more INVALID_DATA extents in the pNFS enables clients to do direct block access, it is useful for
layout that cover the same file_offset range. When performing a write clients to participate in copy-on-write operations. All block/volume
to such an area of a layout, the client MUST effectively copy the pNFS clients MUST support this copy-on-write processing.
data from the READ_DATA extent for any partial blocks of file_offset
and range, merge in the changes to be written, and write the result When a client wishes to write data covered by a PNFS_BLOCK_READ_DATA
to the INVALID_DATA extent for the blocks for that file_offset and extent, it MUST have requested a writable layout from the server;
range. That is, if entire blocks of data are to be overwritten by an that layout will contain PNFS_BLOCK_INVALID_DATA extents to cover all
operation, the corresponding READ_DATA blocks need not be fetched, the data ranges of that layout's PNFS_BLOCK_READ_DATA extents. More
but any partial-block writes must be merged with data fetched via precisely, for any file_offset range covered by one or more
READ_DATA extents before storing the result via INVALID_DATA extents. PNFS_BLOCK_READ_DATA extents in a writable layout, the server MUST
For the purposes of this discussion, "entire blocks" and "partial include one or more PNFS_BLOCK_INVALID_DATA extents in the layout
blocks" refer to the server's file-system block size. Storing of that cover the same file_offset range. When performing a write to
data in an INVALID_DATA extent converts the written portion of the such an area of a layout, the client MUST effectively copy the data
INVALID_DATA extent to a READ_WRITE_DATA extent; all subsequent reads from the PNFS_BLOCK_READ_DATA extent for any partial blocks of
MUST be performed from this extent; the corresponding portion of the file_offset and range, merge in the changes to be written, and write
READ_DATA extent MUST NOT be used after storing data in an the result to the PNFS_BLOCK_INVALID_DATA extent for the blocks for
INVALID_DATA extent. that file_offset and range. That is, if entire blocks of data are to
be overwritten by an operation, the corresponding
PNFS_BLOCK_READ_DATA blocks need not be fetched, but any partial-
block writes must be merged with data fetched via
PNFS_BLOCK_READ_DATA extents before storing the result via
PNFS_BLOCK_INVALID_DATA extents. For the purposes of this
discussion, "entire blocks" and "partial blocks" refer to the
server's file-system block size. Storing of data in a
PNFS_BLOCK_INVALID_DATA extent converts the written portion of the
PNFS_BLOCK_INVALID_DATA extent to a PNFS_BLOCK_READ_WRITE_DATA
extent; all subsequent reads MUST be performed from this extent; the
corresponding portion of the PNFS_BLOCK_READ_DATA extent MUST NOT be
used after storing data in a PNFS_BLOCK_INVALID_DATA extent. If a
client writes only a portion of an extent, the extent may be split at
block aligned boundaries.
When a client wishes to write data to a PNFS_BLOCK_INVALID_DATA
extent that is not covered by a PNFS_BLOCK_READ_DATA extent, it MUST
treat 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 size increments, aligned to multiples of block sized offsets,
and unwritten portions of blocks must be zero filled.
In the LAYOUTCOMMIT operation that normally sends updated layout In the LAYOUTCOMMIT operation that normally sends updated layout
information back to the server, for writable data, some INVALID_DATA information back to the server, for writable data, some
extents may be committed as READ_WRITE_DATA extents, signifying that PNFS_BLOCK_INVALID_DATA extents may be committed as
the storage at the corresponding storage_offset values has been PNFS_BLOCK_READ_WRITE_DATA extents, signifying that the storage at
stored into and is now to be considered as valid data to be read. the corresponding storage_offset values has been stored into and is
READ_DATA extents are not committed to the server. For extents that now to be considered as valid data to be read. PNFS_BLOCK_READ_DATA
the client receives via LAYOUTGET as INVALID_DATA and returns via extents are not committed to the server. For extents that the client
LAYOUTCOMMIT as READ_WRITE_DATA, the server will understand that the receives via LAYOUTGET as PNFS_BLOCK_INVALID_DATA and returns via
READ_DATA mapping for that extent is no longer valid or necessary for LAYOUTCOMMIT as PNFS_BLOCK_READ_WRITE_DATA, the server will
that file. understand that the PNFS_BLOCK_READ_DATA mapping for that extent is
no longer valid or necessary for that file.
2.3.5. Extents are Permissions 2.3.5. 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; READ_DATA and NONE_DATA are read-only (NONE_DATA reads as write; PNFS_BLOCK_READ_DATA and PNFS_BLOCK_NONE_DATA are read-only
zeroes), READ_WRITE_DATA and INVALID_DATA are read/write, (PNFS_BLOCK_NONE_DATA reads as zeroes), PNFS_BLOCK_READ_WRITE_DATA
(INVALID_DATA reads as zeros, any write converts it to and PNFS_BLOCK_INVALID_DATA are read/write, (PNFS_BLOCK_INVALID_DATA
READ_WRITE_DATA). This is the only client means of obtaining reads as zeros, any write converts it to PNFS_BLOCK_READ_WRITE_DATA).
permission to perform direct I/O to storage devices; a pNFS client This is the only client means of obtaining permission to perform
MUST NOT perform direct I/O operations that are not permitted by an direct I/O to storage devices; a pNFS client MUST NOT perform direct
extent held by the client. Client adherence to this rule places the I/O operations that are not permitted by an extent held by the
pNFS server in control of potentially conflicting storage device client. Client adherence to this rule places the pNFS server in
operations, enabling the server to determine what does conflict and control of potentially conflicting storage device operations,
how to avoid conflicts by granting and recalling extents to/from enabling the server to determine what does conflict and how to avoid
clients. conflicts by granting and recalling extents to/from clients.
Block/volume class storage devices are not required to perform read Block/volume class storage devices are not required to perform read
and write operations atomically. Overlapping concurrent read and and write operations atomically. Overlapping concurrent read and
write operations to the same data may cause the read to return a write operations to the same data may cause the read to return a
mixture of before-write and after-write data. Overlapping write mixture of before-write and after-write data. Overlapping write
operations can be worse, as the result could be a mixture of data operations can be worse, as the result could be a mixture of data
from the two write operations; data corruption can occur if the from the two write operations; data corruption can occur if the
underlying storage is striped and the operations complete in underlying storage is striped and the operations complete in
different orders on different stripes. A pNFS server can avoid these different orders on different stripes. A pNFS server can avoid these
conflicts by implementing a single writer XOR multiple readers conflicts by implementing a single writer XOR multiple readers
skipping to change at page 15, line 23 skipping to change at page 16, line 44
rejected. Once the original requesting client retries its request, rejected. Once the original requesting client retries its request,
its entry in the rejected request queue can be cleared, or the entry its entry in the rejected request queue can be cleared, or the entry
in the rejected request queue can be removed when it reaches a in the rejected request queue can be removed when it reaches a
certain age. certain age.
NFSv4 supports mandatory locks and share reservations. These are NFSv4 supports mandatory locks and share reservations. These are
mechanisms that clients can use to restrict the set of I/O operations mechanisms that clients can use to restrict the set of I/O operations
that are permissible to other clients. Since all I/O operations that are permissible to other clients. Since all I/O operations
ultimately arrive at the NFSv4 server for processing, the server is ultimately arrive at the NFSv4 server for processing, the server is
in a position to enforce these restrictions. However, with pNFS in a position to enforce these restrictions. However, with pNFS
layout delegations, I/Os will be issued from the clients that hold layouts, I/Os will be issued from the clients that hold the layouts
the delegations directly to the storage devices that host the data. directly to the storage devices that host the data. These devices
These devices have no knowledge of files, mandatory locks, or share have no knowledge of files, mandatory locks, or share reservations,
reservations, and are not in a position to enforce such restrictions. and are not in a position to enforce such restrictions. For this
For this reason the NFSv4 server MUST NOT grant layout delegations reason the NFSv4 server MUST NOT grant layouts that conflict with
that conflict with mandatory locks or share reservations. Further, mandatory locks or share reservations. Further, if a conflicting
if a conflicting mandatory lock request or a conflicting open request mandatory lock request or a conflicting open request arrives at the
arrives at the server, the server MUST recall the part of the layout server, the server MUST recall the part of the layout in conflict
delegation in conflict with the request before granting the request. with the request before granting the request.
2.3.6. End-of-file Processing 2.3.6. End-of-file Processing
The end-of-file location can be changed in two ways: implicitly as The end-of-file location can be changed in two ways: implicitly as
the result of a WRITE or LAYOUTCOMMIT beyond the current end-of-file, the result of a WRITE or LAYOUTCOMMIT beyond the current end-of-file,
or explicitly as the result of a SETATTR request. Typically, when a or explicitly as the result of a SETATTR request. Typically, when a
file is truncated by an NFSv4 client via the SETATTR call, the server file is truncated by an NFSv4 client via the SETATTR call, the server
frees any disk blocks belonging to the file which are beyond the new frees any disk blocks belonging to the file which are beyond the new
end-of-file octet, and may write zeros to the portion of the new end- end-of-file byte, and MUST write zeros to the portion of the new end-
of-file block beyond the new end-of-file octet. These actions render of-file block beyond the new end-of-file byte. These actions render
any pNFS layouts which refer to the blocks that are freed or written any pNFS layouts which refer to the blocks that are freed or written
semantically invalid. Therefore, the server MUST recall from clients semantically invalid. Therefore, the server MUST recall from clients
the portions of any pNFS layouts which refer to blocks that will be the portions of any pNFS layouts which refer to blocks that will be
freed or written by the server before processing the truncate freed or written by the server before processing the truncate
request. These recalls may take time to complete; as explained in request. These recalls may take time to complete; as explained in
[NFSv4.1], if the server cannot respond to the client SETATTR request [NFSv4.1], if the server cannot respond to the client SETATTR request
in a reasonable amount of time, it SHOULD reply to the client with in a reasonable amount of time, it SHOULD reply to the client with
the error NFS4ERR_DELAY. the error NFS4ERR_DELAY.
Blocks in the INVALID_DATA state which lie beyond the new end-of-file Blocks in the PNFS_BLOCK_INVALID_DATA state which lie beyond the new
block present a special case. The server has reserved these blocks end-of-file block present a special case. The server has reserved
for use by a pNFS client with a writable layout for the file, but the these blocks for use by a pNFS client with a writable layout for the
client has yet to commit the blocks, and they are not yet a part of file, but the client has yet to commit the blocks, and they are not
the file mapping on disk. The server MAY free these blocks while yet a part of the file mapping on disk. The server MAY free these
processing the SETATTR request. If so, the server MUST recall any blocks while processing the SETATTR request. If so, the server MUST
layouts from pNFS clients which refer to the blocks before processing recall any layouts from pNFS clients which refer to the blocks before
the truncate. If the server does not free the INVALID_DATA blocks processing the truncate. If the server does not free the
while processing the SETATTR request, it need not recall layouts PNFS_BLOCK_INVALID_DATA blocks while processing the SETATTR request,
which refer only to the INVALID DATA blocks. it need not recall layouts which refer only to the PNFS_BLOCK_INVALID
DATA blocks.
When a file is extended implicitly by a WRITE or LAYOUTCOMMIT beyond When a file is extended implicitly by a WRITE or LAYOUTCOMMIT beyond
the current end-of-file, or extended explicitly by a SETATTR request, the current end-of-file, or extended explicitly by a SETATTR request,
the server need not recall any portions of any pNFS layouts. the server need not recall any portions of any pNFS layouts.
2.3.7. Client Fencing 2.3.7. Layout Hints
The SETATTR operation supports a layout hint attribute [NFSv4.1].
When the client sets a layout hint (data type layouthint4) with a
layout type of LAYOUT4_BLOCK_VOLUME (the loh_type field), the
loh_body field contains a value of data type pnfs_block_layouthint4.
struct pnfs_block_layouthint4 {
uint64_t maximum_io_time; /* maximum i/o time in seconds
*/
};
The block layout client uses the layout hint data structure to
communicate to the server the maximum time that it may take an I/O to
execute on the client. Clients using block layouts it MUST set the
layout hint attribute before using LAYOUTGET operations.
2.3.8. Client Fencing
The pNFS block protocol must handle situations in which a system The pNFS block protocol must handle situations in which a system
failure, typically a network connectivity issue, requires the server failure, typically a network connectivity issue, requires the server
to unilaterally revoke extents from one client in order to transfer to unilaterally revoke extents from one client in order to transfer
the extents to another client. The pNFS server implementation MUST the extents to another client. The pNFS server implementation MUST
ensure that when resources are transferred to another client, they ensure that when resources are transferred to another client, they
are not used by the client originally owning them, and this must be are not used by the client originally owning them, and this must be
ensured against any possible combination of partitions and delays ensured against any possible combination of partitions and delays
among all of the participants to the protocol (server, storage and among all of the participants to the protocol (server, storage and
client). Several approaches to guaranteeing this isolation are client). Two approaches to guaranteeing this isolation are possible
possible and are discussed below. and are discussed below.
One server based implementation choice for fencing is to use the One implementation choice for fencing the block client from the block
STOMITH (Shoot The Other Machine In The Head) protocol, i.e., turn storage is the use of LUN (Logical Unit Number) masking or mapping at
off the power to the client machine that needs to be isolated. This the storage systems or storage area network to disable access by the
is possible if the server has access to either an IPMI interface to client to be isolated. This requires server access to a management
power cycle the client, or an alternate method of turning off power interface for the storage system and authorization to perform LUN
to a non-communicative client. The client SHOULD be kept powered off masking and management operations. For example, SMI-S [SMIS]
for at least the duration of the server lease time, as it is provides a means to discover and mask LUNs, including a means of
possible, although untypical, that the client caches the layout associating clients with the necessary World Wide Names or Initiator
information on persistent storage. This approach can in some names to be masked.
instances guarantee that the rogue client no longer is capable of
accessing the storage. However, in other situations, for example
lack of TCP/IP access to the client's IPMI network address, this
approach cannot guarantee anything.
Another implementation choice for fencing the block client from the In the absence of support for LUN masking, the server has to rely on
block storage is the use of LUN (Logical Unit Number) masking or the clients to implement a timed lease I/O fencing mechanism.
mapping at the storage systems or storage area network to disable Because clients do not know if the server is using LUN masking, in
access by the client to be isolated. In contrast to the STOMITH all cases the client MUST implement timed lease fencing. In timed
approach, this requires server access to a management interface for lease fencing we define two time periods, the first, "lease_time" is
the storage system and authorization to perform LUN masking and the length of a lease as defined by the server's lease_time attribute
management operations. For example, SMI-S [SMIS] provides a means to (see [NFSV4.1]), and the second, "maximum_io_time" is the maximum
discover and mask LUNs, including a means of associating clients with time it can take for a client I/O to the storage system to either
the necessary World Wide Names or Initiator names to be masked. complete or fail; this value is often 30 seconds or 60 seconds, but
may be longer in some environments. If the maximum client I/O time
cannot be bounded, the client MUST use a value of all 1s as the
maximum_io_time.
In the absence of support for other mechanisms, the server MUST The client MUST use SETATTR with a layout hint of type
choose to rely on the clients to implement a timed lease I/O fencing LAYOUT4_BLOCK_VOLUME to inform the server of its maximum_I/O time
mechanism. Because clients do not know if the server is using prior to issuing the first LAYOUTGET operation. The maximum io time
STOMITH or LUN masking. in all cases the client MUST implement timed hint is a per client attribute, and as such the server SHOULD
lease fencing. In timed lease fencing we define two time periods, maintain the value set by each client. A server which implements
the first, "lease_time" is the length of a lease as defined by the fencing via LUN masking SHOULD accept any maximum io time value from
server's lease_time attribute (see Section 5.4 of [NFSV4.1]), and the a client. A server which does not implement fencing may return an
second, "maximum_io_time" is the maximum time it can take for a error NFS4ERR_INVAL to the SETATTR operation. Such a server SHOULD
client I/O to the storage system to either complete or fail; this return NFS4ERR_INVAL when a client sends an unbounded maximum I/O
value is often 30 seconds or 60 seconds, but may be longer in some time (all 1s), or when the maximum I/O time is significantly greater
environments. If the maximum client I/O time cannot be bounded, this than that of other clients using block layouts with pNFS.
timed lease mechanism MUST NOT be used. The client can use GETATTR
to query the server's default setting of "maximum_io_time". The When a client receives the error NFS4ERR_INVAL in response to the
server must respond with the maximum I/O time in seconds. If the SETATTR operation for a layout hint, the client MUST NOT use the
client's maximum I/O time is greater than the server's default, then LAYOUTGET operation. After responding with NFS4ERR_INVAL to the
the client MUST use SETATTR to inform the server of its maximum_I/O SETATTR for layout hint, the server MUST return the error
time. Using these two time span values, we specify the behavior of NFS4ERR_LAYOUTUNAVAILABLE to all subsequent LAYOUTGET operations from
the client and server as follows. that client. Thus the server, by returning either NFS4ERR_INVAL or
NFS4_OK determines whether or not a client with a large, or an
unbounded maximum I/O time may use pNFS.
Using the lease time and the maximum i/o time values, we specify the
behavior of the client and server as follows.
When a client receives layout information via a LAYOUTGET operation, When a client receives layout information via a LAYOUTGET operation,
those layouts are valid for at most "lease_time" seconds from when those layouts are valid for at most "lease_time" seconds from when
the server granted them. A layout is renewed by any successful the server granted them. A layout is renewed by any successful
SEQUEUNCE operation, or whenever a new stateid is created or updated SEQUEUNCE operation, or whenever a new stateid is created or updated
(see the section "Lease Renewal" of [NFSV4.1]). If the layout lease (see the section "Lease Renewal" of [NFSV4.1]). If the layout lease
is not renewed prior to expiration, the client MUST cease to use the is not renewed prior to expiration, the client MUST cease to use the
layout after "lease_time" seconds from when it either sent the layout after "lease_time" seconds from when it either sent the
original LAYOUTGET command, or sent the last operation renewing the original LAYOUTGET command, or sent the last operation renewing the
lease. In other words, the client may not issue any I/O to blocks lease. In other words, the client may not issue any I/O to blocks
specified by an expired layout. In the presence of large specified by an expired layout. In the presence of large
communication delays between the client and server it is even communication delays between the client and server it is even
possible for the lease to expire prior to the server response possible for the lease to expire prior to the server response
arriving at the client. In such a situation the client MUST NOT use arriving at the client. In such a situation the client MUST NOT use
the expired layouts, and SHOULD revert to using standard NFSv41 READ the expired layouts, and SHOULD revert to using standard NFSv41 READ
and WRITE operations. Furthermore, the client must be configured and WRITE operations. Furthermore, the client must be configured
such that I/O operations complete within the "maximum_io_time" even such that I/O operations complete within the "maximum_io_time" even
in the presence of multipathing drivers that will retry I/Os via in the presence of multipath drivers that will retry I/Os via
multiple paths. If a client cannot guarantee a bounded maximum I/O multiple paths.
time, it MUST NOT use pNFS.
As stated in the section "Dealing with Lease Expiration on the As stated in the section "Dealing with Lease Expiration on the
Client" of [NFSV4.1], if any SEQUENCE operation is successful, but Client" of [NFSV4.1], if any SEQUENCE operation is successful, but
sr_status_flag has SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED, sr_status_flag has SEQ4_STATUS_EXPIRED_ALL_STATE_REVOKED,
SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, or SEQ4_STATUS_EXPIRED_SOME_STATE_REVOKED, or
SEQ4_STATUS_ADMIN_STATE_REVOKED set, the client MUST immediately SEQ4_STATUS_ADMIN_STATE_REVOKED set, the client MUST immediately
cease to use all layouts and device id to device address mappings cease to use all layouts and device id to device address mappings
associated with the corresponding server. associated with the corresponding server.
In the absence of known two way communication between the client and In the absence of known two way communication between the client and
skipping to change at page 18, line 21 skipping to change at page 20, line 21
time period "lease_time" plus "maximum_io_time" before transferring time period "lease_time" plus "maximum_io_time" before transferring
layouts from the original client to any other client. The server, layouts from the original client to any other client. The server,
like the client, must take a conservative approach, and start the like the client, must take a conservative approach, and start the
lease expiration timer from the time that it received the operation lease expiration timer from the time that it received the operation
which last renewed the lease. which last renewed the lease.
2.4. Crash Recovery Issues 2.4. Crash Recovery Issues
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 INVALID_DATA state, the client has two blocks are still in the PNFS_BLOCK_INVALID_DATA state, the client has
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 [NFSv4.1] section 18.42.4. in [NFSv4.1] section 18.42.4.
2.5. Recalling resources: CB_RECALL_ANY 2.5. 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.
For the block layout we define the following bit For the block layout we define the following bit
const RCA4_BLK_LAYOUT_RECALL_ANY_LAYOUTS = 4 const RCA4_BLK_LAYOUT_RECALL_ANY_LAYOUTS = 4;
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_BLK_LAYOUT_RECALL_ANY_LAYOUTS bit in craa_type_mask, the the RCA4_BLK_LAYOUT_RECALL_ANY_LAYOUTS bit in craa_type_mask, the
client should immediately respond with NFS4_OK, and then client should immediately respond with NFS4_OK, and then
asynchronously return complete file layouts until the number of files asynchronously return complete file layouts until the number of files
with layouts cached on the client is less the craa_object_to_keep. with layouts cached on the client is less the craa_object_to_keep.
The block layout does not currently use bits 5, 6 or 7. If any of The block layout does not currently use bits 5, 6 or 7. If any of
these bits are set, the client should return NFS4ERR_INVAL. these bits are set, the client should return NFS4ERR_INVAL.
skipping to change at page 21, line 22 skipping to change at page 23, line 28
4. Conclusions 4. Conclusions
This draft specifies the block/volume layout type for pNFS and This draft specifies the block/volume layout type for pNFS and
associated functionality. associated functionality.
5. IANA Considerations 5. IANA Considerations
There are no IANA considerations in this document. All pNFS IANA There are no IANA considerations in this document. All pNFS IANA
Considerations are covered in [NFSV4.1]. Considerations are covered in [NFSV4.1].
6. Revision History 6. Acknowledgments
-00: Initial Version as draft-black-pnfs-block-00
-01: Rework discussion of extents as locks to talk about extents
granting access permissions. Rewrite operation ordering section to
discuss deadlocks and races that can cause problems. Add new section
on recall completion. Add client copy-on-write based on text from
Craig Everhart.
-02: Fix glitches in extent state descriptions. Describe most issues
as RESOLVED. Most of Section 3 has been incorporated into the the
main PNFD draft, add NOTE to that effect and say that it will be
deleted in the next version of this draft (which should be a draft-
ietf-nfsv4 draft). Cleaning up a number of things have been left to
that draft revision, including the interlocks with the types in the
main pNFS draft, layout striping support, and finishing the Security
Considerations section.
-00: New version as draft-ietf-nfsv4-pnfs-block. Removed resolved
operations issues (Section 3). Align types with main pNFS draft
(which is now part of the NFSv4.1 minor version draft), add volume
striping and slicing support. New operations issues are in Section 3
- the need for a "reclaim bit" and EOF concerns are the two major
issues. Extended and improved the Security Considerations section,
but it still needs work. Added 1-sentence conclusion that also still
needs work.
-01: Changed definition of pnfs_block_deviceaddr4 union to allow more
concise representation of aggregated volume structures. Fixed typos
to make both pnfs_block_layoutupdate and pnfs_block_layoutreturn
structures contain extent lists instead of a single extent. Updated
section 2.1.6 to remove references to CB_SIZECHANGED. Moved
description of recovery from "Issues" section to "Block Layout
Description" section. Removed section 3.2 "End-of-file handling
issues". Merged old "block/volume layout security considerations"
section from previous version of [NFSv4.1] with section 4. Moved
paragraph on lingering writes to the section which describes layout
return. Removed Issues section (3) as the remaining issues are all
resolved.
02: Changed pnfs_deviceaddr4 to deviceaddr4 to match [NFSv4.1].
Updated section 2.2.2 to clarify that the es fields must be
READ_WRITE_DATA in pnfs_block_layoutupdate requests. Updated section
2.2.5 to specify that data corruption can occur; that requests, not
the client, are rejected; that server "SHOULD" recall conflicting
portions of layouts. Clarified that unilateral revocation may affect
layouts from other filesystems. Changed signature offset to be a
signed quantity to allow for labels at a fixed location from the end
of a volume. Changed all data structures to have suffix "4", changed
extentState4 to pnfs_block_extent_state4 and sigComponent to
pnfs_block_sig_component4, to conform to [NFSv4.1].
03: Moved sections GETDEVICELIST and GETDEVICEINFO earlier in
document for better readability. Added pnfs_block_simple_volume4
data structure, and added volume_id fields to all pnfs_block volume
info data structures.
04: Added information about device ids to clarify their usage.
Described where the pnfs_block_deviceaddr4 data structure is found to
be accurate with draft-ietf-nfsv4-minorversion1-14. Updated
references from -08 to -14. Removed root_id from
pnfs_block_deviceaddr4. Changed 'byte' to 'octet'. Clarify the
block size and stripe size in volume data structures. Rename
'volume' and 'id' to be 'vol_id' consistently. Added sections on
CB_RECALL_ANY and fencing.
7. Acknowledgments
This draft draws extensively on the authors' familiarity with the This draft draws extensively on the authors' familiarity with the
mapping functionality and protocol in EMC's HighRoad system mapping functionality and protocol in EMC's HighRoad system
[HighRoad]. The protocol used by HighRoad is called FMP (File [HighRoad]. The protocol used by HighRoad is called FMP (File
Mapping Protocol); it is an add-on protocol that runs in parallel Mapping Protocol); it is an add-on protocol that runs in parallel
with filesystem protocols such as NFSv3 to provide pNFS-like with filesystem protocols such as NFSv3 to provide pNFS-like
functionality for block/volume storage. While drawing on HighRoad functionality for block/volume storage. While drawing on HighRoad
FMP, the data structures and functional considerations in this draft FMP, the data structures and functional considerations in this draft
differ in significant ways, based on lessons learned and the differ in significant ways, based on lessons learned and the
opportunity to take advantage of NFSv4 features such as COMPOUND opportunity to take advantage of NFSv4 features such as COMPOUND
operations. The design to support pNFS client participation in copy- operations. The design to support pNFS client participation in copy-
on-write is based on text and ideas contributed by Craig Everhart on-write is based on text and ideas contributed by Craig Everhart
(formerly with IBM). (formerly with IBM).
8. References 7. References
8.1. Normative References 7.1. Normative References
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[NFSV4.1] Shepler, S., Eisler, M., and Noveck, D. ed., "NFSv4 Minor [NFSV4.1] Shepler, S., Eisler, M., and Noveck, D. ed., "NFSv4 Minor
Version 1", draft-ietf-nfsv4-minorversion1-14.txt, Internet Version 1", draft-ietf-nfsv4-minorversion1-14.txt, Internet
Draft, July 2007. Draft, July 2007.
8.2. Informative References 7.2. Informative References
[HighRoad] EMC Corporation, "EMC Celerra HighRoad", EMC C819.1 white [HighRoad] EMC Corporation, "EMC Celerra HighRoad", EMC C819.1 white
paper, available at: paper, available at:
http://www.emc.com/pdf/products/celerra_file_server/HighRoad_wp.pdf http://www.emc.com/pdf/products/celerra_file_server/HighRoad_wp.pdf
link checked 29 August 2006. link checked 29 August 2006.
[SMIS] SNIA, "SNIA Storage Management Initiative Specification", [SMIS] SNIA, "SNIA Storage Management Initiative Specification",
version 1.0.2, available at: version 1.0.2, available at:
http://www.snia.org/smi/tech_activities/smi_spec_pr/spec/SMIS_1_0_2_f http://www.snia.org/smi/tech_activities/smi_spec_pr/spec/SMIS_1_0_2_f
inal.pdf inal.pdf
 End of changes. 77 change blocks. 
416 lines changed or deleted 431 lines changed or added

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