draft-ietf-nfsv4-minorversion2-21.txt   draft-ietf-nfsv4-minorversion2-22.txt 
NFSv4 T. Haynes, Ed. NFSv4 T. Haynes, Ed.
Internet-Draft NetApp Internet-Draft Primary Data
Intended status: Standards Track February 03, 2014 Intended status: Standards Track April 13, 2014
Expires: August 7, 2014 Expires: October 15, 2014
NFS Version 4 Minor Version 2 NFS Version 4 Minor Version 2
draft-ietf-nfsv4-minorversion2-21.txt draft-ietf-nfsv4-minorversion2-22.txt
Abstract Abstract
This Internet-Draft describes NFS version 4 minor version two, This Internet-Draft describes NFS version 4 minor version two,
focusing mainly on the protocol extensions made from NFS version 4 focusing mainly on the protocol extensions made from NFS version 4
minor version 0 and NFS version 4 minor version 1. Major extensions minor version 0 and NFS version 4 minor version 1. Major extensions
introduced in NFS version 4 minor version two include: Server-side introduced in NFS version 4 minor version two include: Server-side
Copy, Application I/O Advise, Space Reservations, Sparse Files, Copy, Application I/O Advise, Space Reservations, Sparse Files,
Application Data Blocks, and Labeled NFS. Application Data Blocks, and Labeled NFS.
Requirements Language Requirements Language
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].
Status of this Memo Status of This Memo
This Internet-Draft is submitted in full conformance with the This Internet-Draft is submitted in full conformance with the
provisions of BCP 78 and BCP 79. provisions of BCP 78 and BCP 79.
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 August 7, 2014. This Internet-Draft will expire on October 15, 2014.
Copyright Notice Copyright Notice
Copyright (c) 2014 IETF Trust and the persons identified as the Copyright (c) 2014 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
carefully, as they describe your rights and restrictions with respect carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must to this document. Code Components extracted from this document must
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 . . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. The NFS Version 4 Minor Version 2 Protocol . . . . . . . 5 1.1. The NFS Version 4 Minor Version 2 Protocol . . . . . . . 4
1.2. Scope of This Document . . . . . . . . . . . . . . . . . 5 1.2. Scope of This Document . . . . . . . . . . . . . . . . . 4
1.3. NFSv4.2 Goals . . . . . . . . . . . . . . . . . . . . . . 5 1.3. NFSv4.2 Goals . . . . . . . . . . . . . . . . . . . . . . 5
1.4. Overview of NFSv4.2 Features . . . . . . . . . . . . . . 6 1.4. Overview of NFSv4.2 Features . . . . . . . . . . . . . . 5
1.4.1. Server-side Copy . . . . . . . . . . . . . . . . . . . 6 1.4.1. Server-side Copy . . . . . . . . . . . . . . . . . . 5
1.4.2. Application I/O Advise . . . . . . . . . . . . . . . . 6 1.4.2. Application I/O Advise . . . . . . . . . . . . . . . 5
1.4.3. Sparse Files . . . . . . . . . . . . . . . . . . . . . 6 1.4.3. Sparse Files . . . . . . . . . . . . . . . . . . . . 5
1.4.4. Space Reservation . . . . . . . . . . . . . . . . . . 6 1.4.4. Space Reservation . . . . . . . . . . . . . . . . . . 6
1.4.5. Application Data Hole (ADH) Support . . . . . . . . . 6 1.4.5. Application Data Hole (ADH) Support . . . . . . . . . 6
1.4.6. Labeled NFS . . . . . . . . . . . . . . . . . . . . . 6 1.4.6. Labeled NFS . . . . . . . . . . . . . . . . . . . . . 6
1.5. Differences from NFSv4.1 . . . . . . . . . . . . . . . . 7 1.5. Differences from NFSv4.1 . . . . . . . . . . . . . . . . 6
2. Minor Versioning . . . . . . . . . . . . . . . . . . . . . . . 7 2. Minor Versioning . . . . . . . . . . . . . . . . . . . . . . 6
3. Server-side Copy . . . . . . . . . . . . . . . . . . . . . . . 10 3. Server-side Copy . . . . . . . . . . . . . . . . . . . . . . 10
3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 10 3.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 10
3.2. Protocol Overview . . . . . . . . . . . . . . . . . . . . 11 3.2. Protocol Overview . . . . . . . . . . . . . . . . . . . . 10
3.2.1. Overview of Copy Operations . . . . . . . . . . . . . 11 3.2.1. Overview of Copy Operations . . . . . . . . . . . . . 11
3.2.2. Locking the Files . . . . . . . . . . . . . . . . . . 12 3.2.2. Locking the Files . . . . . . . . . . . . . . . . . . 11
3.2.3. Intra-Server Copy . . . . . . . . . . . . . . . . . . 12 3.2.3. Intra-Server Copy . . . . . . . . . . . . . . . . . . 11
3.2.4. Inter-Server Copy . . . . . . . . . . . . . . . . . . 14 3.2.4. Inter-Server Copy . . . . . . . . . . . . . . . . . . 13
3.2.5. Server-to-Server Copy Protocol . . . . . . . . . . . . 18 3.2.5. Server-to-Server Copy Protocol . . . . . . . . . . . 17
3.3. Requirements for Operations . . . . . . . . . . . . . . . 19 3.3. Requirements for Operations . . . . . . . . . . . . . . . 18
3.3.1. netloc4 - Network Locations . . . . . . . . . . . . . 20 3.3.1. netloc4 - Network Locations . . . . . . . . . . . . . 19
3.3.2. Copy Offload Stateids . . . . . . . . . . . . . . . . 20 3.3.2. Copy Offload Stateids . . . . . . . . . . . . . . . . 19
3.4. Security Considerations . . . . . . . . . . . . . . . . . 21 3.4. Security Considerations . . . . . . . . . . . . . . . . . 20
3.4.1. Inter-Server Copy Security . . . . . . . . . . . . . . 21 3.4.1. Inter-Server Copy Security . . . . . . . . . . . . . 20
4. Support for Application IO Hints . . . . . . . . . . . . . . . 31 4. Support for Application IO Hints . . . . . . . . . . . . . . 30
5. Sparse Files . . . . . . . . . . . . . . . . . . . . . . . . . 31 5. Sparse Files . . . . . . . . . . . . . . . . . . . . . . . . 31
5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 31 5.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 31
5.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 32 5.2. Terminology . . . . . . . . . . . . . . . . . . . . . . . 31
5.3. New Operations . . . . . . . . . . . . . . . . . . . . . 33 5.3. New Operations . . . . . . . . . . . . . . . . . . . . . 32
5.3.1. READ_PLUS . . . . . . . . . . . . . . . . . . . . . . 33 5.3.1. READ_PLUS . . . . . . . . . . . . . . . . . . . . . . 32
5.3.2. WRITE_PLUS . . . . . . . . . . . . . . . . . . . . . . 33 5.3.2. WRITE_HOLE and WRITE_SAME . . . . . . . . . . . . . . 32
6. Space Reservation . . . . . . . . . . . . . . . . . . . . . . 33 6. Space Reservation . . . . . . . . . . . . . . . . . . . . . . 33
6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 34 6.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 33
7. Application Data Hole Support . . . . . . . . . . . . . . . . 36 7. Application Data Hole Support . . . . . . . . . . . . . . . . 35
7.1. Generic Framework . . . . . . . . . . . . . . . . . . . . 36 7.1. Generic Framework . . . . . . . . . . . . . . . . . . . . 36
7.1.1. Data Hole Representation . . . . . . . . . . . . . . . 37 7.1.1. Data Hole Representation . . . . . . . . . . . . . . 36
7.1.2. Data Content . . . . . . . . . . . . . . . . . . . . . 38 7.1.2. Data Content . . . . . . . . . . . . . . . . . . . . 37
7.2. An Example of Detecting Corruption . . . . . . . . . . . 38 7.2. An Example of Detecting Corruption . . . . . . . . . . . 37
7.3. Example of READ_PLUS . . . . . . . . . . . . . . . . . . 39 7.3. Example of READ_PLUS . . . . . . . . . . . . . . . . . . 38
8. Labeled NFS . . . . . . . . . . . . . . . . . . . . . . . . . 40 8. Labeled NFS . . . . . . . . . . . . . . . . . . . . . . . . . 39
8.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 40 8.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 39
8.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . 41 8.2. Definitions . . . . . . . . . . . . . . . . . . . . . . . 40
8.3. MAC Security Attribute . . . . . . . . . . . . . . . . . 41 8.3. MAC Security Attribute . . . . . . . . . . . . . . . . . 40
8.3.1. Delegations . . . . . . . . . . . . . . . . . . . . . 42 8.3.1. Delegations . . . . . . . . . . . . . . . . . . . . . 41
8.3.2. Permission Checking . . . . . . . . . . . . . . . . . 42 8.3.2. Permission Checking . . . . . . . . . . . . . . . . . 41
8.3.3. Object Creation . . . . . . . . . . . . . . . . . . . 43 8.3.3. Object Creation . . . . . . . . . . . . . . . . . . . 42
8.3.4. Existing Objects . . . . . . . . . . . . . . . . . . . 43 8.3.4. Existing Objects . . . . . . . . . . . . . . . . . . 42
8.3.5. Label Changes . . . . . . . . . . . . . . . . . . . . 43 8.3.5. Label Changes . . . . . . . . . . . . . . . . . . . . 42
8.4. pNFS Considerations . . . . . . . . . . . . . . . . . . . 44 8.4. pNFS Considerations . . . . . . . . . . . . . . . . . . . 43
8.5. Discovery of Server Labeled NFS Support . . . . . . . . . 44 8.5. Discovery of Server Labeled NFS Support . . . . . . . . . 43
8.6. MAC Security NFS Modes of Operation . . . . . . . . . . . 44 8.6. MAC Security NFS Modes of Operation . . . . . . . . . . . 43
8.6.1. Full Mode . . . . . . . . . . . . . . . . . . . . . . 44 8.6.1. Full Mode . . . . . . . . . . . . . . . . . . . . . . 43
8.6.2. Guest Mode . . . . . . . . . . . . . . . . . . . . . . 46 8.6.2. Guest Mode . . . . . . . . . . . . . . . . . . . . . 45
8.7. Security Considerations . . . . . . . . . . . . . . . . . 46 8.7. Security Considerations . . . . . . . . . . . . . . . . . 45
9. Sharing change attribute implementation details with NFSv4 9. Sharing change attribute implementation details with NFSv4
clients . . . . . . . . . . . . . . . . . . . . . . . . . . . 47 clients . . . . . . . . . . . . . . . . . . . . . . . . . . . 46
9.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 47 9.1. Introduction . . . . . . . . . . . . . . . . . . . . . . 46
10. Security Considerations . . . . . . . . . . . . . . . . . . . 47 10. Security Considerations . . . . . . . . . . . . . . . . . . . 46
11. Error Values . . . . . . . . . . . . . . . . . . . . . . . . . 47 11. Error Values . . . . . . . . . . . . . . . . . . . . . . . . 46
11.1. Error Definitions . . . . . . . . . . . . . . . . . . . . 48 11.1. Error Definitions . . . . . . . . . . . . . . . . . . . 47
11.1.1. General Errors . . . . . . . . . . . . . . . . . . . . 48 11.1.1. General Errors . . . . . . . . . . . . . . . . . . . 47
11.1.2. Server to Server Copy Errors . . . . . . . . . . . . . 48 11.1.2. Server to Server Copy Errors . . . . . . . . . . . . 47
11.1.3. Labeled NFS Errors . . . . . . . . . . . . . . . . . . 49 11.1.3. Labeled NFS Errors . . . . . . . . . . . . . . . . . 48
11.2. New Operations and Their Valid Errors . . . . . . . . . . 49 11.2. New Operations and Their Valid Errors . . . . . . . . . 48
11.3. New Callback Operations and Their Valid Errors . . . . . 52 11.3. New Callback Operations and Their Valid Errors . . . . . 51
12. New File Attributes . . . . . . . . . . . . . . . . . . . . . 53 12. New File Attributes . . . . . . . . . . . . . . . . . . . . . 51
12.1. New RECOMMENDED Attributes - List and Definition 12.1. New RECOMMENDED Attributes - List and Definition
References . . . . . . . . . . . . . . . . . . . . . . . 53 References . . . . . . . . . . . . . . . . . . . . . . . 51
12.2. Attribute Definitions . . . . . . . . . . . . . . . . . . 53 12.2. Attribute Definitions . . . . . . . . . . . . . . . . . 52
13. Operations: REQUIRED, RECOMMENDED, or OPTIONAL . . . . . . . . 57 13. Operations: REQUIRED, RECOMMENDED, or OPTIONAL . . . . . . . 55
14. NFSv4.2 Operations . . . . . . . . . . . . . . . . . . . . . . 60 14. NFSv4.2 Operations . . . . . . . . . . . . . . . . . . . . . 59
14.1. Operation 59: COPY - Initiate a server-side copy . . . . 60 14.1. Operation 59: COPY - Initiate a server-side copy . . . . 59
14.2. Operation 60: OFFLOAD_ABORT - Cancel a server-side 14.2. Operation 60: OFFLOAD_ABORT - Cancel a server-side copy 63
copy . . . . . . . . . . . . . . . . . . . . . . . . . . 64 14.3. Operation 61: COPY_NOTIFY - Notify a source server of a
14.3. Operation 61: COPY_NOTIFY - Notify a source server of future copy . . . . . . . . . . . . . . . . . . . . . . 63
a future copy . . . . . . . . . . . . . . . . . . . . . . 65
14.4. Operation 62: OFFLOAD_REVOKE - Revoke a destination 14.4. Operation 62: OFFLOAD_REVOKE - Revoke a destination
server's copy privileges . . . . . . . . . . . . . . . . 66 server's copy privileges . . . . . . . . . . . . . . . . 65
14.5. Operation 63: OFFLOAD_STATUS - Poll for status of a 14.5. Operation 63: OFFLOAD_STATUS - Poll for status of a
server-side copy . . . . . . . . . . . . . . . . . . . . 67 server-side copy . . . . . . . . . . . . . . . . . . . . 66
14.6. Modification to Operation 42: EXCHANGE_ID - 14.6. Modification to Operation 42: EXCHANGE_ID - Instantiate
Instantiate Client ID . . . . . . . . . . . . . . . . . . 68 Client ID . . . . . . . . . . . . . . . . . . . . . . . 67
14.7. Operation 64: WRITE_PLUS . . . . . . . . . . . . . . . . 69 14.7. Operation 67: IO_ADVISE - Application I/O access pattern
14.8. Operation 67: IO_ADVISE - Application I/O access hints . . . . . . . . . . . . . . . . . . . . . . . . . 68
pattern hints . . . . . . . . . . . . . . . . . . . . . . 75 14.8. Changes to Operation 51: LAYOUTRETURN . . . . . . . . . 74
14.9. Changes to Operation 51: LAYOUTRETURN . . . . . . . . . . 80 14.9. Operation 65: READ_PLUS . . . . . . . . . . . . . . . . 77
14.10. Operation 65: READ_PLUS . . . . . . . . . . . . . . . . . 83 14.10. Operation 66: SEEK . . . . . . . . . . . . . . . . . . . 82
14.11. Operation 66: SEEK . . . . . . . . . . . . . . . . . . . 88 14.11. Operation 64: WRITE_HOLE . . . . . . . . . . . . . . . . 83
15. NFSv4.2 Callback Operations . . . . . . . . . . . . . . . . . 89 14.12. Operation 68: WRITE_SAME . . . . . . . . . . . . . . . . 86
15. NFSv4.2 Callback Operations . . . . . . . . . . . . . . . . . 89
15.1. Operation 15: CB_OFFLOAD - Report results of an 15.1. Operation 15: CB_OFFLOAD - Report results of an
asynchronous operation . . . . . . . . . . . . . . . . . 89 asynchronous operation . . . . . . . . . . . . . . . . . 89
16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 90 16. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 91
17. References . . . . . . . . . . . . . . . . . . . . . . . . . . 90 17. References . . . . . . . . . . . . . . . . . . . . . . . . . 91
17.1. Normative References . . . . . . . . . . . . . . . . . . 90 17.1. Normative References . . . . . . . . . . . . . . . . . . 91
17.2. Informative References . . . . . . . . . . . . . . . . . 91 17.2. Informative References . . . . . . . . . . . . . . . . . 92
Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . . 92 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . 93
Appendix B. RFC Editor Notes . . . . . . . . . . . . . . . . . . 93 Appendix B. RFC Editor Notes . . . . . . . . . . . . . . . . . . 94
Author's Address . . . . . . . . . . . . . . . . . . . . . . . . . 94 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 94
1. Introduction 1. Introduction
1.1. The NFS Version 4 Minor Version 2 Protocol 1.1. The NFS Version 4 Minor Version 2 Protocol
The NFS version 4 minor version 2 (NFSv4.2) protocol is the third The NFS version 4 minor version 2 (NFSv4.2) protocol is the third
minor version of the NFS version 4 (NFSv4) protocol. The first minor minor version of the NFS version 4 (NFSv4) protocol. The first minor
version, NFSv4.0, is described in [I-D.ietf-nfsv4-rfc3530bis] and the version, NFSv4.0, is described in [I-D.ietf-nfsv4-rfc3530bis] and the
second minor version, NFSv4.1, is described in [RFC5661]. It follows second minor version, NFSv4.1, is described in [RFC5661]. It follows
the guidelines for minor versioning that are listed in Section 11 of the guidelines for minor versioning that are listed in Section 11 of
skipping to change at page 6, line 18 skipping to change at page 5, line 34
A traditional file copy from one server to another results in the A traditional file copy from one server to another results in the
data being put on the network twice - source to client and then data being put on the network twice - source to client and then
client to destination. New operations are introduced to allow the client to destination. New operations are introduced to allow the
client to authorize the two servers to interact directly. As this client to authorize the two servers to interact directly. As this
copy can be lengthy, asynchronous support is also provided. copy can be lengthy, asynchronous support is also provided.
1.4.2. Application I/O Advise 1.4.2. Application I/O Advise
Applications and clients want to advise the server as to expected I/O Applications and clients want to advise the server as to expected I/O
behavior. Using IO_ADVISE (see Section 14.8) to communicate future behavior. Using IO_ADVISE (see Section 14.7) to communicate future I
I/O behavior such as whether a file will be accessed sequentially or /O behavior such as whether a file will be accessed sequentially or
randomly, and whether a file will or will not be accessed in the near randomly, and whether a file will or will not be accessed in the near
future, allows servers to optimize future I/O requests for a file by, future, allows servers to optimize future I/O requests for a file by,
for example, prefetching or evicting data. This operation can be for example, prefetching or evicting data. This operation can be
used to support the posix_fadvise function as well as other used to support the posix_fadvise function as well as other
applications such as databases and video editors. applications such as databases and video editors.
1.4.3. Sparse Files 1.4.3. Sparse Files
Sparse files are ones which have unallocated data blocks as holes in Sparse files are ones which have unallocated data blocks as holes in
the file. Such holes are typically transferred as 0s during I/O. the file. Such holes are typically transferred as 0s during I/O.
READ_PLUS (see Section 14.10) allows a server to send back to the READ_PLUS (see Section 14.9) allows a server to send back to the
client metadata describing the hole and WRITE_PLUS (see Section 14.7) client metadata describing the hole and WRITE_HOLE (see
allows the client to punch holes into a file. In addition, SEEK (see Section 14.11) allows the client to punch holes into a file. In
Section 14.11) is provided to scan for the next hole or data from a addition, SEEK (see Section 14.10) is provided to scan for the next
given location. hole or data from a given location.
1.4.4. Space Reservation 1.4.4. Space Reservation
When a file is sparse, one concern applications have is ensuring that When a file is sparse, one concern applications have is ensuring that
there will always be enough data blocks available for the file during there will always be enough data blocks available for the file during
future writes. A new attribute, space_reserved (see Section 12.2.4) future writes. A new attribute, space_reserved (see Section 12.2.4)
provides the client a guarantee that space will be available. provides the client a guarantee that space will be available.
1.4.5. Application Data Hole (ADH) Support 1.4.5. Application Data Hole (ADH) Support
Some applications treat a file as if it were a disk and as such want Some applications treat a file as if it were a disk and as such want
to initialize (or format) the file image. We extend both READ_PLUS to initialize (or format) the file image. We extend both READ_PLUS
and WRITE_PLUS to understand this metadata as a new form of a hole. and introduce WRITE_SAME (see Section 14.12) to understand this
metadata as a new form of a hole.
1.4.6. Labeled NFS 1.4.6. Labeled NFS
While both clients and servers can employ Mandatory Access Control While both clients and servers can employ Mandatory Access Control
(MAC) security models to enforce data access, there has been no (MAC) security models to enforce data access, there has been no
protocol support to allow full interoperability. A new file object protocol support to allow full interoperability. A new file object
attribute, sec_label (see Section 12.2.2) allows for the server to attribute, sec_label (see Section 12.2.2) allows for the server to
store and enforce MAC labels. The format of the sec_label store and enforce MAC labels. The format of the sec_label
accommodates any MAC security system. accommodates any MAC security system.
skipping to change at page 18, line 48 skipping to change at page 17, line 48
(e.g., HTTP [RFC2616] or FTP [RFC0959]) presents some challenges. In (e.g., HTTP [RFC2616] or FTP [RFC0959]) presents some challenges. In
particular, the destination server is presented with the challenge of particular, the destination server is presented with the challenge of
accessing the source file given only an NFSv4.x filehandle. accessing the source file given only an NFSv4.x filehandle.
One option for protocols that identify source files with path names One option for protocols that identify source files with path names
is to use an ASCII hexadecimal representation of the source is to use an ASCII hexadecimal representation of the source
filehandle as the file name. filehandle as the file name.
Another option for the source server is to use URLs to direct the Another option for the source server is to use URLs to direct the
destination server to a specialized service. For example, the destination server to a specialized service. For example, the
response to COPY_NOTIFY could include the URL response to COPY_NOTIFY could include the URL ftp://
ftp://s1.example.com:9999/_FH/0x12345, where 0x12345 is the ASCII s1.example.com:9999/_FH/0x12345, where 0x12345 is the ASCII
hexadecimal representation of the source filehandle. When the hexadecimal representation of the source filehandle. When the
destination server receives the source server's URL, it would use destination server receives the source server's URL, it would use
"_FH/0x12345" as the file name to pass to the FTP server listening on "_FH/0x12345" as the file name to pass to the FTP server listening on
port 9999 of s1.example.com. On port 9999 there would be a special port 9999 of s1.example.com. On port 9999 there would be a special
instance of the FTP service that understands how to convert NFS instance of the FTP service that understands how to convert NFS
filehandles to an open file descriptor (in many operating systems, filehandles to an open file descriptor (in many operating systems,
this would require a new system call, one which is the inverse of the this would require a new system call, one which is the inverse of the
makefh() function that the pre-NFSv4 MOUNT service needs). makefh() function that the pre-NFSv4 MOUNT service needs).
Authenticating and identifying the destination server to the source Authenticating and identifying the destination server to the source
skipping to change at page 23, line 8 skipping to change at page 22, line 12
the destination server to perform READs of the file to be copied from the destination server to perform READs of the file to be copied from
the source on behalf of the user principal. Once the copy is the source on behalf of the user principal. Once the copy is
complete, the client can destroy the RPCSEC_GSSv3 handles to end the complete, the client can destroy the RPCSEC_GSSv3 handles to end the
source and destination servers authorization to copy. source and destination servers authorization to copy.
RPCSEC_GSSv3 introduces the notion of RPC application defined RPCSEC_GSSv3 introduces the notion of RPC application defined
structured privileges. We define three structured privileges that structured privileges. We define three structured privileges that
work in tandum to authorize the copy: work in tandum to authorize the copy:
copy_from_auth: A user principal is authorizing a source principal copy_from_auth: A user principal is authorizing a source principal
("nfs@<source>") to allow a destination principal ("nfs@ ("nfs@<source>") to allow a destination principal
<destination>") to setup the copy_confirm_auth privilege required ("nfs@<destination>") to setup the copy_confirm_auth privilege
to copy a file from the source to the destination on behalf of the required to copy a file from the source to the destination on
user principal. This privilege is established on the source behalf of the user principal. This privilege is established on
server before the user principal sends a COPY_NOTIFY operation to the source server before the user principal sends a COPY_NOTIFY
the source server, and the resultant RPCSEC_GSSv3 context is used operation to the source server, and the resultant RPCSEC_GSSv3
to secure the COPY_NOTIFY operation. context is used to secure the COPY_NOTIFY operation.
struct copy_from_auth_priv { struct copy_from_auth_priv {
secret4 cfap_shared_secret; secret4 cfap_shared_secret;
netloc4 cfap_destination; netloc4 cfap_destination;
/* the NFSv4 user name that the user principal maps to */ /* the NFSv4 user name that the user principal maps to */
utf8str_mixed cfap_username; utf8str_mixed cfap_username;
}; };
cfp_shared_secret is an automatically generated random number cfp_shared_secret is an automatically generated random number
secret value. secret value.
skipping to change at page 24, line 24 skipping to change at page 23, line 24
*/ */
opaque ctap_handle; opaque ctap_handle;
int ctap_handle_vers; int ctap_handle_vers;
/* A nounce and a mic of the nounce using ctap_handle */ /* A nounce and a mic of the nounce using ctap_handle */
opaque ctap_nounce; opaque ctap_nounce;
opaque ctap_nounce_mic; opaque ctap_nounce_mic;
}; };
ctap_shared_secret is the automatically generated secret value ctap_shared_secret is the automatically generated secret value
used to establish the copy_from_auth privilege with the source used to establish the copy_from_auth privilege with the source
principal. ctap_handle, ctap_handle_vers, ctap_nounce and principal. ctap_handle, ctap_handle_vers, ctap_nounce and
ctap_nounce_mic are used to construct the compound authentication ctap_nounce_mic are used to construct the compound authentication
portion of the copy_confirm_auth RPCGSS_GSSv3 context between the portion of the copy_confirm_auth RPCGSS_GSSv3 context between the
destination server and the source server. See Section 3.4.1.2.1 destination server and the source server. See Section 3.4.1.2.1
copy_confirm_auth: A destination principal ("nfs@<destination>") is copy_confirm_auth: A destination principal ("nfs@<destination>") is
confirming with the source principal ("nfs@<source>") that it is confirming with the source principal ("nfs@<source>") that it is
authorized to copy data from the source. Note that besides the authorized to copy data from the source. Note that besides the
rpc_gss3_privs payload (struct copy_confirm_auth_priv), the rpc_gss3_privs payload (struct copy_confirm_auth_priv), the
copy_confirm_auth RPCSEC_GSS3_CREATE message also contains an copy_confirm_auth RPCSEC_GSS3_CREATE message also contains an
rpc_gss3_gss_binding payload so that the copy is done on behalf of rpc_gss3_gss_binding payload so that the copy is done on behalf of
skipping to change at page 26, line 44 skipping to change at page 25, line 44
assertions[0].assertion.privs.name. The field assertions[0].assertion.privs.name. The field
assertions[0].critical is set to TRUE. The destination server assertions[0].critical is set to TRUE. The destination server
unwraps the rpc_gss_svc_privacy RPCSEC_GSS3_CREATE payload and unwraps the rpc_gss_svc_privacy RPCSEC_GSS3_CREATE payload and
verifies that the NFSv4 user id being asserted matches the verifies that the NFSv4 user id being asserted matches the
destination server's mapping of the user principal. If it does, destination server's mapping of the user principal. If it does,
the privilege is established on the destination server as: the privilege is established on the destination server as:
<"copy_to_auth", user id, source list, nounce, nounce MIC, context <"copy_to_auth", user id, source list, nounce, nounce MIC, context
handle, handle version>. The field "handle" in a successful reply handle, handle version>. The field "handle" in a successful reply
is the RPCSEC_GSSv3 "child" handle that the client will use on is the RPCSEC_GSSv3 "child" handle that the client will use on
COPY requests to the destination server involving the source COPY requests to the destination server involving the source
server. granted_assertions[0].assertion.privs.name will be equal server. granted_assertions[0].assertion.privs.name will be equal
to "copy_to_auth". to "copy_to_auth".
As noted in [rpcsec_gssv3] section 2.3.1 "Create Request", both the As noted in [rpcsec_gssv3] section 2.3.1 "Create Request", both the
client and the source server should associate the RPCSEC_GSSv3 client and the source server should associate the RPCSEC_GSSv3
"child" handle with the parent RPCSEC_GSSv1 (or v2) handle used to "child" handle with the parent RPCSEC_GSSv1 (or v2) handle used to
create the RPCSEC_GSSv3 child handle. create the RPCSEC_GSSv3 child handle.
3.4.1.2.2. Starting a Secure Inter-Server Copy 3.4.1.2.2. Starting a Secure Inter-Server Copy
When the client sends a COPY_NOTIFY request to the source server, it When the client sends a COPY_NOTIFY request to the source server, it
skipping to change at page 31, line 36 skipping to change at page 30, line 39
The same techniques as Section 3.4.1.3, using unique URLs for each The same techniques as Section 3.4.1.3, using unique URLs for each
destination server, can be used for other protocols (e.g., HTTP destination server, can be used for other protocols (e.g., HTTP
[RFC2616] and FTP [RFC0959]) as well. [RFC2616] and FTP [RFC0959]) as well.
4. Support for Application IO Hints 4. Support for Application IO Hints
Applications can issue client I/O hints via posix_fadvise() Applications can issue client I/O hints via posix_fadvise()
[posix_fadvise] to the NFS client. While this can help the NFS [posix_fadvise] to the NFS client. While this can help the NFS
client optimize I/O and caching for a file, it does not allow the NFS client optimize I/O and caching for a file, it does not allow the NFS
server and its exported file system to do likewise. We add an server and its exported file system to do likewise. We add an
IO_ADVISE procedure (Section 14.8) to communicate the client file IO_ADVISE procedure (Section 14.7) to communicate the client file
access patterns to the NFS server. The NFS server upon receiving a access patterns to the NFS server. The NFS server upon receiving a
IO_ADVISE operation MAY choose to alter its I/O and caching behavior, IO_ADVISE operation MAY choose to alter its I/O and caching behavior,
but is under no obligation to do so. but is under no obligation to do so.
Application specific NFS clients such as those used by hypervisors Application specific NFS clients such as those used by hypervisors
and databases can also leverage application hints to communicate and databases can also leverage application hints to communicate
their specialized requirements. their specialized requirements.
5. Sparse Files 5. Sparse Files
skipping to change at page 32, line 27 skipping to change at page 31, line 34
the zeroes to be transferred. the zeroes to be transferred.
A sparse file is typically created by initializing the file to be all A sparse file is typically created by initializing the file to be all
zeros - nothing is written to the data in the file, instead the hole zeros - nothing is written to the data in the file, instead the hole
is recorded in the metadata for the file. So a 8G disk image might is recorded in the metadata for the file. So a 8G disk image might
be represented initially by a couple hundred bits in the inode and be represented initially by a couple hundred bits in the inode and
nothing on the disk. If the VM then writes 100M to a file in the nothing on the disk. If the VM then writes 100M to a file in the
middle of the image, there would now be two holes represented in the middle of the image, there would now be two holes represented in the
metadata and 100M in the data. metadata and 100M in the data.
Two new operations WRITE_PLUS (Section 14.7) and READ_PLUS Three new operations WRITE_HOLE (Section 14.11), WRITE_SAME
(Section 14.10) are introduced. WRITE_PLUS allows for the creation (Section 14.12), and READ_PLUS (Section 14.9) are introduced.
of a sparse file and for hole punching. An application might want to WRITE_HOLE allows for the creation of a sparse file and/or hole
zero out a range of the file. READ_PLUS supports all the features of punching. I.e, An application might want to zero out a range of the
READ but includes an extension to support sparse pattern files file. WRITE_SAME allows for the creation of application specific
block structures in a file which is treated by the application as if
it were a disk. READ_PLUS supports all the features of READ but
includes an extension to support sparse pattern files
(Section 7.1.2). READ_PLUS is guaranteed to perform no worse than (Section 7.1.2). READ_PLUS is guaranteed to perform no worse than
READ, and can dramatically improve performance with sparse files. READ, and can dramatically improve performance with sparse files.
READ_PLUS does not depend on pNFS protocol features, but can be used READ_PLUS does not depend on pNFS protocol features, but can be used
by pNFS to support sparse files. by pNFS to support sparse files.
5.2. Terminology 5.2. Terminology
Regular file: An object of file type NF4REG or NF4NAMEDATTR. Regular file: An object of file type NF4REG or NF4NAMEDATTR.
Sparse file: A Regular file that contains one or more Holes. Sparse file: A Regular file that contains one or more Holes.
skipping to change at page 33, line 7 skipping to change at page 32, line 16
zeroes. For block-based file systems, this could also be an zeroes. For block-based file systems, this could also be an
unallocated region of the file. unallocated region of the file.
Hole Threshold: The minimum length of a Hole as determined by the Hole Threshold: The minimum length of a Hole as determined by the
server. If a server chooses to define a Hole Threshold, then it server. If a server chooses to define a Hole Threshold, then it
would not return hole information about holes with a length would not return hole information about holes with a length
shorter than the Hole Threshold. shorter than the Hole Threshold.
5.3. New Operations 5.3. New Operations
READ_PLUS and WRITE_PLUS are new variants of the NFSv4.1 READ and READ_PLUS, WRITE_HOLE, and WRITE_SAME are new variants of the NFSv4.1
WRITE operations [RFC5661]. Besides being able to support all of the READ and WRITE operations [RFC5661]. Besides being able to support
data semantics of those operations, they can also be used by the all of the data semantics of those operations, they can also be used
client and server to efficiently transfer both holes and ADHs (see by the client and server to efficiently transfer both holes and ADHs
Section 7.1.1). As both READ and WRITE are inefficient for transfer (see Section 7.1.1). As READ is inefficient for transfer of sparse
of sparse sections of the file, they are marked as OBSOLESCENT in sections of the file, it is marked as OBSOLESCENT in NFSv4.2.
NFSv4.2. Instead, a client should utilize READ_PLUS and WRITE_PLUS. Instead, a client should utilize READ_PLUS. Note that as the client
Note that as the client has no a priori knowledge of whether either has no a priori knowledge of whether either an ADH or a hole is
an ADH or a hole is present or not, if it supports these operations present or not, if it supports these operations and so does the
and so does the server, then it should always use these operations. server, then it should always use these operations.
5.3.1. READ_PLUS 5.3.1. READ_PLUS
For holes, READ_PLUS extends the response to avoid returning data for For holes, READ_PLUS extends the response to avoid returning data for
portions of the file which are initialized and contain no backing portions of the file which are initialized and contain no backing
store. Additionally it will do so if the result would appear to be a store. Additionally it will do so if the result would appear to be a
hole. I.e., if the result was a data block composed entirely of hole. I.e., if the result was a data block composed entirely of
zeros, then it is easier to return a hole. Returning data blocks of zeros, then it is easier to return a hole. Returning data blocks of
uninitialized data wastes computational and network resources, thus uninitialized data wastes computational and network resources, thus
reducing performance. For ADHs, READ_PLUS is used to return the reducing performance. For ADHs, READ_PLUS is used to return the
skipping to change at page 33, line 39 skipping to change at page 32, line 48
If the client sends a READ operation, it is explicitly stating that If the client sends a READ operation, it is explicitly stating that
it is neither supporting sparse files nor ADHs. So if a READ occurs it is neither supporting sparse files nor ADHs. So if a READ occurs
on a sparse ADH or file, then the server must expand such data to be on a sparse ADH or file, then the server must expand such data to be
raw bytes. If a READ occurs in the middle of a hole or ADH, the raw bytes. If a READ occurs in the middle of a hole or ADH, the
server can only send back bytes starting from that offset. In server can only send back bytes starting from that offset. In
contrast, if a READ_PLUS occurs in the middle of a hole or ADH, the contrast, if a READ_PLUS occurs in the middle of a hole or ADH, the
server can send back a range which starts before the offset and server can send back a range which starts before the offset and
extends past the range. extends past the range.
5.3.2. WRITE_PLUS 5.3.2. WRITE_HOLE and WRITE_SAME
WRITE_PLUS can be used to either hole punch or initialize ADHs. For WRITE_HOLE can be used to hole punch and WRITE_SAME can be used to
either purpose, the client can avoid the transfer of a repetitive initialize ADHs. For either purpose, the client can avoid the
pattern across the network. If the filesystem on the server does not transfer of a repetitive pattern across the network. If the
support sparse files, the WRITE_PLUS operation may return the result filesystem on the server does not support sparse files, the
WRITE_HOLE and WRITE_SAME operations may return the result
asynchronously via the CB_OFFLOAD operation. As a hole punch may asynchronously via the CB_OFFLOAD operation. As a hole punch may
entail deallocating data blocks, even if the filesystem supports entail deallocating data blocks, even if the filesystem supports
sparse files, it may still have to return the result via CB_OFFLOAD. sparse files, it may still have to return the result via CB_OFFLOAD.
6. Space Reservation 6. Space Reservation
6.1. Introduction 6.1. Introduction
Applications such as hypervisors want to be able to reserve space for Applications such as hypervisors want to be able to reserve space for
a file, report the amount of actual disk space a file occupies, and a file, report the amount of actual disk space a file occupies, and
free-up the backing space of a file when it is not required. In free-up the backing space of a file when it is not required. In
virtualized environments, virtual disk files are often stored on NFS virtualized environments, virtual disk files are often stored on NFS
mounted volumes. Since virtual disk files represent the hard disks mounted volumes. Since virtual disk files represent the hard disks
of virtual machines, hypervisors often have to guarantee certain of virtual machines, hypervisors often have to guarantee certain
properties for the file. properties for the file.
skipping to change at page 35, line 21 skipping to change at page 34, line 29
The following operations and attributes can be used to resolve this The following operations and attributes can be used to resolve this
issues: issues:
space_reserved This attribute specifies that writes to the reserved space_reserved This attribute specifies that writes to the reserved
area of the file will not fail with NFS4ERR_NOSPACE. area of the file will not fail with NFS4ERR_NOSPACE.
space_freed This attribute specifies the space freed when a file is space_freed This attribute specifies the space freed when a file is
deleted, taking block sharing into consideration. deleted, taking block sharing into consideration.
WRITE_PLUS This operation zeroes and/or deallocates the blocks WRITE_HOLE and WRITE_SAME These operations zero and/or deallocate
backing a region of the file. the blocks backing a region of the file.
If space_used of a file is interpreted to mean the size in bytes of If space_used of a file is interpreted to mean the size in bytes of
all disk blocks pointed to by the inode of the file, then shared all disk blocks pointed to by the inode of the file, then shared
blocks get double counted, over-reporting the space utilization. blocks get double counted, over-reporting the space utilization.
This also has the adverse effect that the deletion of a file with This also has the adverse effect that the deletion of a file with
shared blocks frees up less than space_used bytes. shared blocks frees up less than space_used bytes.
On the other hand, if space_used is interpreted to mean the size in On the other hand, if space_used is interpreted to mean the size in
bytes of those disk blocks unique to the inode of the file, then bytes of those disk blocks unique to the inode of the file, then
shared blocks are not counted in any file, resulting in under- shared blocks are not counted in any file, resulting in under-
skipping to change at page 39, line 49 skipping to change at page 38, line 49
totally unaware of the file format and might report everything as totally unaware of the file format and might report everything as
being transferred correctly even in the case the application detects being transferred correctly even in the case the application detects
corruption. corruption.
7.3. Example of READ_PLUS 7.3. Example of READ_PLUS
The hypothetical application presented in Section 7.2 can be used to The hypothetical application presented in Section 7.2 can be used to
illustrate how READ_PLUS would return an array of results. A file is illustrate how READ_PLUS would return an array of results. A file is
created and initialized with 100 4k ADHs in the FREE state: created and initialized with 100 4k ADHs in the FREE state:
WRITE_PLUS {0, 4k, 100, 0, 0, 8, 0xfeedface} WRITE_SAME {0, 4k, 100, 0, 0, 8, 0xfeedface}
Further, assume the application writes a single ADH at 16k, changing Further, assume the application writes a single ADH at 16k, changing
the guard pattern to 0xcafedead, we would then have in memory: the guard pattern to 0xcafedead, we would then have in memory:
0 -> (16k - 1) : 4k, 4, 0, 0, 8, 0xfeedface 0 -> (16k - 1) : 4k, 4, 0, 0, 8, 0xfeedface
16k -> (20k - 1) : 00 00 00 05 ca fe de ad XX XX ... XX XX 16k -> (20k - 1) : 00 00 00 05 ca fe de ad XX XX ... XX XX
20k -> 400k : 4k, 95, 0, 6, 0xfeedface 20k -> 400k : 4k, 95, 0, 6, 0xfeedface
And when the client did a READ_PLUS of 64k at the start of the file, And when the client did a READ_PLUS of 64k at the start of the file,
it would get back a result of an ADH, some data, and a final ADH: it would get back a result of an ADH, some data, and a final ADH:
skipping to change at page 48, line 31 skipping to change at page 47, line 31
11.1.1. General Errors 11.1.1. General Errors
This section deals with errors that are applicable to a broad set of This section deals with errors that are applicable to a broad set of
different purposes. different purposes.
11.1.1.1. NFS4ERR_UNION_NOTSUPP (Error Code 10090) 11.1.1.1. NFS4ERR_UNION_NOTSUPP (Error Code 10090)
One of the arguments to the operation is a discriminated union and One of the arguments to the operation is a discriminated union and
while the server supports the given operation, it does not support while the server supports the given operation, it does not support
the selected arm of the discriminated union. For an example, see the selected arm of the discriminated union.
WRITE_PLUS (Section 14.7).
11.1.2. Server to Server Copy Errors 11.1.2. Server to Server Copy Errors
These errors deal with the interaction between server to server These errors deal with the interaction between server to server
copies. copies.
11.1.2.1. NFS4ERR_OFFLOAD_DENIED (Error Code 10091) 11.1.2.1. NFS4ERR_OFFLOAD_DENIED (Error Code 10091)
The copy offload operation is supported by both the source and the The copy offload operation is supported by both the source and the
destination, but the destination is not allowing it for this file. destination, but the destination is not allowing it for this file.
skipping to change at page 52, line 4 skipping to change at page 50, line 29
| | NFS4ERR_UNION_NOTSUPP, NFS4ERR_WRONG_TYPE | | | NFS4ERR_UNION_NOTSUPP, NFS4ERR_WRONG_TYPE |
| SEQUENCE | NFS4ERR_BADSESSION, NFS4ERR_BADSLOT, | | SEQUENCE | NFS4ERR_BADSESSION, NFS4ERR_BADSLOT, |
| | NFS4ERR_BADXDR, NFS4ERR_BAD_HIGH_SLOT, | | | NFS4ERR_BADXDR, NFS4ERR_BAD_HIGH_SLOT, |
| | NFS4ERR_CONN_NOT_BOUND_TO_SESSION, | | | NFS4ERR_CONN_NOT_BOUND_TO_SESSION, |
| | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, |
| | NFS4ERR_REP_TOO_BIG, | | | NFS4ERR_REP_TOO_BIG, |
| | NFS4ERR_REP_TOO_BIG_TO_CACHE, | | | NFS4ERR_REP_TOO_BIG_TO_CACHE, |
| | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, |
| | NFS4ERR_SEQUENCE_POS, NFS4ERR_SEQ_FALSE_RETRY, | | | NFS4ERR_SEQUENCE_POS, NFS4ERR_SEQ_FALSE_RETRY, |
| | NFS4ERR_SEQ_MISORDERED, NFS4ERR_TOO_MANY_OPS | | | NFS4ERR_SEQ_MISORDERED, NFS4ERR_TOO_MANY_OPS |
| WRITE_PLUS | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, | | WRITE_HOLE | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, |
| | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, | | | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, |
| | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, |
| | NFS4ERR_DELEG_REVOKED, NFS4ERR_DQUOT, | | | NFS4ERR_DELEG_REVOKED, NFS4ERR_DQUOT, |
| | NFS4ERR_EXPIRED, NFS4ERR_FBIG, | | | NFS4ERR_EXPIRED, NFS4ERR_FBIG, |
| | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, | | | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, |
| | NFS4ERR_IO, NFS4ERR_ISDIR, NFS4ERR_LOCKED, | | | NFS4ERR_IO, NFS4ERR_ISDIR, NFS4ERR_LOCKED, |
| | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, | | | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, |
| | NFS4ERR_NOSPC, NFS4ERR_OLD_STATEID, | | | NFS4ERR_NOSPC, NFS4ERR_NOTSUPP, |
| | NFS4ERR_OPENMODE, NFS4ERR_OP_NOT_IN_SESSION, | | | NFS4ERR_OLD_STATEID, NFS4ERR_OPENMODE, |
| | NFS4ERR_PNFS_IO_HOLE, NFS4ERR_PNFS_NO_LAYOUT, | | | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PNFS_IO_HOLE, |
| | NFS4ERR_REP_TOO_BIG, | | | NFS4ERR_PNFS_NO_LAYOUT, NFS4ERR_REP_TOO_BIG, |
| | NFS4ERR_REP_TOO_BIG_TO_CACHE, | | | NFS4ERR_REP_TOO_BIG_TO_CACHE, |
| | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, | | | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, |
| | NFS4ERR_ROFS, NFS4ERR_SERVERFAULT, | | | NFS4ERR_ROFS, NFS4ERR_SERVERFAULT, |
| | NFS4ERR_STALE, NFS4ERR_SYMLINK, | | | NFS4ERR_STALE, NFS4ERR_SYMLINK, |
| | NFS4ERR_TOO_MANY_OPS, NFS4ERR_UNION_NOTSUPP, | | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE |
| | NFS4ERR_WRONG_TYPE | | WRITE_SAME | NFS4ERR_ACCESS, NFS4ERR_ADMIN_REVOKED, |
| | NFS4ERR_BADXDR, NFS4ERR_BAD_STATEID, |
| | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, |
| | NFS4ERR_DELEG_REVOKED, NFS4ERR_DQUOT, |
| | NFS4ERR_EXPIRED, NFS4ERR_FBIG, |
| | NFS4ERR_FHEXPIRED, NFS4ERR_GRACE, NFS4ERR_INVAL, |
| | NFS4ERR_IO, NFS4ERR_ISDIR, NFS4ERR_LOCKED, |
| | NFS4ERR_MOVED, NFS4ERR_NOFILEHANDLE, |
| | NFS4ERR_NOSPC, NFS4ERR_NOTSUPP, |
| | NFS4ERR_OLD_STATEID, NFS4ERR_OPENMODE, |
| | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PNFS_IO_HOLE, |
| | NFS4ERR_PNFS_NO_LAYOUT, NFS4ERR_REP_TOO_BIG, |
| | NFS4ERR_REP_TOO_BIG_TO_CACHE, |
| | NFS4ERR_REQ_TOO_BIG, NFS4ERR_RETRY_UNCACHED_REP, |
| | NFS4ERR_ROFS, NFS4ERR_SERVERFAULT, |
| | NFS4ERR_STALE, NFS4ERR_SYMLINK, |
| | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE |
+----------------+--------------------------------------------------+ +----------------+--------------------------------------------------+
Table 2 Table 2
11.3. New Callback Operations and Their Valid Errors 11.3. New Callback Operations and Their Valid Errors
This section contains a table that gives the valid error returns for This section contains a table that gives the valid error returns for
each new NFSv4.2 callback operation. The error code NFS4_OK each new NFSv4.2 callback operation. The error code NFS4_OK
(indicating no error) is not listed but should be understood to be (indicating no error) is not listed but should be understood to be
returnable by all new callback operations. The error values for all returnable by all new callback operations. The error values for all
skipping to change at page 59, line 17 skipping to change at page 57, line 47
| DELEGRETURN | OPT | FDELG, DDELG, pNFS | | DELEGRETURN | OPT | FDELG, DDELG, pNFS |
| | | (REQ) | | | | (REQ) |
| DESTROY_CLIENTID | REQ | | | DESTROY_CLIENTID | REQ | |
| DESTROY_SESSION | REQ | | | DESTROY_SESSION | REQ | |
| EXCHANGE_ID | REQ | | | EXCHANGE_ID | REQ | |
| FREE_STATEID | REQ | | | FREE_STATEID | REQ | |
| GETATTR | REQ | | | GETATTR | REQ | |
| GETDEVICEINFO | OPT | pNFS (REQ) | | GETDEVICEINFO | OPT | pNFS (REQ) |
| GETDEVICELIST | OPT | pNFS (OPT) | | GETDEVICELIST | OPT | pNFS (OPT) |
| GETFH | REQ | | | GETFH | REQ | |
| WRITE_PLUS | OPT | ADH (REQ) |
| GET_DIR_DELEGATION | OPT | DDELG (REQ) | | GET_DIR_DELEGATION | OPT | DDELG (REQ) |
| LAYOUTCOMMIT | OPT | pNFS (REQ) | | LAYOUTCOMMIT | OPT | pNFS (REQ) |
| LAYOUTGET | OPT | pNFS (REQ) | | LAYOUTGET | OPT | pNFS (REQ) |
| LAYOUTRETURN | OPT | pNFS (REQ) | | LAYOUTRETURN | OPT | pNFS (REQ) |
| LINK | OPT | | | LINK | OPT | |
| LOCK | REQ | | | LOCK | REQ | |
| LOCKT | REQ | | | LOCKT | REQ | |
| LOCKU | REQ | | | LOCKU | REQ | |
| LOOKUP | REQ | | | LOOKUP | REQ | |
| LOOKUPP | REQ | | | LOOKUPP | REQ | |
skipping to change at page 60, line 10 skipping to change at page 58, line 38
| SECINFO_NO_NAME | REC | pNFS file layout | | SECINFO_NO_NAME | REC | pNFS file layout |
| | | (REQ) | | | | (REQ) |
| SEQUENCE | REQ | | | SEQUENCE | REQ | |
| SETATTR | REQ | | | SETATTR | REQ | |
| SETCLIENTID | MNI | | | SETCLIENTID | MNI | |
| SETCLIENTID_CONFIRM | MNI | | | SETCLIENTID_CONFIRM | MNI | |
| SET_SSV | REQ | | | SET_SSV | REQ | |
| TEST_STATEID | REQ | | | TEST_STATEID | REQ | |
| VERIFY | REQ | | | VERIFY | REQ | |
| WANT_DELEGATION | OPT | FDELG (OPT) | | WANT_DELEGATION | OPT | FDELG (OPT) |
| WRITE | REQ (OBS) | | | WRITE | REQ | |
| WRITE_HOLE | OPT | |
| WRITE_SAME | OPT | ADH (REQ) |
+----------------------+---------------------+----------------------+ +----------------------+---------------------+----------------------+
Callback Operations Callback Operations
+-------------------------+-------------------+---------------------+ +-------------------------+-------------------+---------------------+
| Operation | REQ, REC, OPT, or | Feature (REQ, REC, | | Operation | REQ, REC, OPT, or | Feature (REQ, REC, |
| | MNI | or OPT) | | | MNI | or OPT) |
+-------------------------+-------------------+---------------------+ +-------------------------+-------------------+---------------------+
| CB_OFFLOAD | OPT | COPY (REQ) | | CB_OFFLOAD | OPT | COPY (REQ) |
| CB_GETATTR | OPT | FDELG (REQ) | | CB_GETATTR | OPT | FDELG (REQ) |
| CB_LAYOUTRECALL | OPT | pNFS (REQ) | | CB_LAYOUTRECALL | OPT | pNFS (REQ) |
| CB_NOTIFY | OPT | DDELG (REQ) | | CB_NOTIFY | OPT | DDELG (REQ) |
skipping to change at page 69, line 45 skipping to change at page 68, line 29
same client owner with a new verifier until all operations in same client owner with a new verifier until all operations in
progress on the client ID's session are completed or aborted. progress on the client ID's session are completed or aborted.
o The NFS server SHOULD support client ID trunking, and if it does o The NFS server SHOULD support client ID trunking, and if it does
and the EXCHGID4_FLAG_SUPP_FENCE_OPS capability is enabled, then a and the EXCHGID4_FLAG_SUPP_FENCE_OPS capability is enabled, then a
session ID created on one node of the storage cluster MUST be session ID created on one node of the storage cluster MUST be
destroyable via DESTROY_SESSION. In addition, DESTROY_CLIENTID destroyable via DESTROY_SESSION. In addition, DESTROY_CLIENTID
and an EXCHANGE_ID with a new verifier affects all sessions and an EXCHANGE_ID with a new verifier affects all sessions
regardless what node the sessions were created on. regardless what node the sessions were created on.
14.7. Operation 64: WRITE_PLUS 14.7. Operation 67: IO_ADVISE - Application I/O access pattern hints
14.7.1. ARGUMENT
struct data_info4 {
offset4 di_offset;
length4 di_length;
bool di_allocated;
};
struct data4 {
offset4 d_offset;
bool d_allocated;
opaque d_data<>;
};
union write_plus_arg4 switch (data_content4 wpa_content) {
case NFS4_CONTENT_DATA:
data4 wpa_data;
case NFS4_CONTENT_APP_DATA_HOLE:
app_data_hole4 wpa_adh;
case NFS4_CONTENT_HOLE:
data_info4 wpa_hole;
default:
void;
};
struct WRITE_PLUS4args {
/* CURRENT_FH: file */
stateid4 wp_stateid;
stable_how4 wp_stable;
write_plus_arg4 wp_data;
};
14.7.2. RESULT
struct write_response4 {
stateid4 wr_callback_id<1>;
count4 wr_count;
stable_how4 wr_committed;
verifier4 wr_writeverf;
};
union WRITE_PLUS4res switch (nfsstat4 wp_status) {
case NFS4_OK:
write_response4 wp_resok4;
default:
void;
};
14.7.3. DESCRIPTION
The WRITE_PLUS operation is an extension of the NFSv4.1 WRITE
operation (see Section 18.2 of [RFC5661]) and writes data to the
regular file identified by the current filehandle. The server MAY
write fewer bytes than requested by the client.
The WRITE_PLUS argument is comprised of an array of rpr_contents,
each of which describe a data_content4 type of data (Section 7.1.2).
For NFSv4.2, the allowed values are data, ADH, and hole. The array
contents MUST be contiguous in the file. A successful WRITE_PLUS
will construct a reply for wr_count, wr_committed, and wr_writeverf
as per the NFSv4.1 WRITE operation results. If wr_callback_id is
set, it indicates an asynchronous reply (see Section 14.7.3.4).
WRITE_PLUS has to support all of the errors which are returned by
WRITE plus NFS4ERR_UNION_NOTSUPP. If the client asks for a hole and
the server does not support that arm of the discriminated union, but
does support one or more additional arms, it can signal to the client
that it supports the operation, but not the arm with
NFS4ERR_UNION_NOTSUPP.
If the client supports WRITE_PLUS and any arm of the discriminated
union other than NFS4_CONTENT_DATA, it MUST support CB_OFFLOAD.
14.7.3.1. Data
The d_offset specifies the offset where the data should be written.
An d_offset of zero specifies that the write should start at the
beginning of the file. The d_count, as encoded as part of the opaque
data parameter, represents the number of bytes of data that are to be
written. If the d_count is zero, the WRITE_PLUS will succeed and
return a d_count of zero subject to permissions checking.
Note that d_allocated has no meaning for WRITE_PLUS.
The data MUST be written synchronously and MUST follow the same
semantics of COMMIT as does the WRITE operation.
14.7.3.2. Hole punching
Whenever a client wishes to zero the blocks backing a particular
region in the file, it calls the WRITE_PLUS operation with the
current filehandle set to the filehandle of the file in question, and
the equivalent of start offset and length in bytes of the region set
in wpa_hole.di_offset and wpa_hole.di_length respectively. If the
wpa_hole.di_allocated is set to TRUE, then the blocks will be zeroed
and if it is set to FALSE, then they will be deallocated. All
further reads to this region MUST return zeros until overwritten.
The filehandle specified must be that of a regular file.
Situations may arise where di_offset and/or di_offset + di_length
will not be aligned to a boundary that the server does allocations/
deallocations in. For most file systems, this is the block size of
the file system. In such a case, the server can deallocate as many
bytes as it can in the region. The blocks that cannot be deallocated
MUST be zeroed. Except for the block deallocation and maximum hole
punching capability, a WRITE_PLUS operation is to be treated similar
to a write of zeroes.
The server is not required to complete deallocating the blocks
specified in the operation before returning. The server SHOULD
return an asynchronous result if it can determine the operation will
be long running (see Section 14.7.3.4).
If used to hole punch, WRITE_PLUS will result in the space_used
attribute being decreased by the number of bytes that were
deallocated. The space_freed attribute may or may not decrease,
depending on the support and whether the blocks backing the specified
range were shared or not. The size attribute will remain unchanged.
The WRITE_PLUS operation MUST NOT change the space reservation
guarantee of the file. While the server can deallocate the blocks
specified by di_offset and di_length, future writes to this region
MUST NOT fail with NFSERR_NOSPC.
14.7.3.3. ADHs
If the server supports ADHs, then it MUST support the
NFS4_CONTENT_APP_DATA_HOLE arm of the WRITE_PLUS operation. The
server has no concept of the structure imposed by the application.
It is only when the application writes to a section of the file does
order get imposed. In order to detect corruption even before the
application utilizes the file, the application will want to
initialize a range of ADHs using WRITE_PLUS.
For ADHs, when the client invokes the WRITE_PLUS operation, it has
two desired results:
1. The structure described by the app_data_block4 be imposed on the
file.
2. The contents described by the app_data_block4 be sparse.
If the server supports the WRITE_PLUS operation, it still might not
support sparse files. So if it receives the WRITE_PLUS operation,
then it MUST populate the contents of the file with the initialized
ADHs. The server SHOULD return an asynchronous result if it can
determine the operation will be long running (see Section 14.7.3.4).
If the data was already initialized, there are two interesting
scenarios:
1. The data blocks are allocated.
2. Initializing in the middle of an existing ADH.
If the data blocks were already allocated, then the WRITE_PLUS is a
hole punch operation. If WRITE_PLUS supports sparse files, then the
data blocks are to be deallocated. If not, then the data blocks are
to be rewritten in the indicated ADH format.
Since the server has no knowledge of ADHs, it should not report
misaligned creation of ADHs. Even while it can detect them, it
cannot disallow them, as the application might be in the process of
changing the size of the ADHs. Thus the server must be prepared to
handle an WRITE_PLUS into an existing ADH.
This document does not mandate the manner in which the server stores
ADHs sparsely for a file. However, if an WRITE_PLUS arrives that
will force a new ADH to start inside an existing ADH then the server
will have three ADHs instead of two. It will have one up to the new
one for the WRITE_PLUS, one for the WRITE_PLUS, and one for after the
WRITE_PLUS. Note that depending on server specific policies for
block allocation, there may also be some physical blocks allocated to
align the boundaries.
14.7.3.4. Asynchronous Transactions
Both hole punching and ADH initialization may lead to server
determining to service the operation asynchronously. If it decides
to do so, it sets the stateid in wr_callback_id to be that of the
wp_stateid. If it does not set the wr_callback_id, then the result
is synchronous.
When the client determines that the reply will be given
asynchronously, it should not assume anything about the contents of
what it wrote until it is informed by the server that the operation
is complete. It can use OFFLOAD_STATUS (Section 14.5) to monitor the
operation and OFFLOAD_ABORT (Section 14.2) to cancel the operation.
An example of a asynchronous WRITE_PLUS is shown in Figure 6. Note
that as with the COPY operation, WRITE_PLUS must provide a stateid
for tracking the asynchronous operation.
Client Server
+ +
| |
|--- OPEN ---------------------------->| Client opens
|<------------------------------------/| the file
| |
|--- WRITE_PLUS ---------------------->| Client punches
|<------------------------------------/| a hole
| |
| |
|--- OFFLOAD_STATUS ------------------>| Client may poll
|<------------------------------------/| for status
| |
| . | Multiple OFFLOAD_STATUS
| . | operations may be sent.
| . |
| |
|<-- CB_OFFLOAD -----------------------| Server reports results
|\------------------------------------>|
| |
|--- CLOSE --------------------------->| Client closes
|<------------------------------------/| the file
| |
| |
Figure 6: An asynchronous WRITE_PLUS.
When CB_OFFLOAD informs the client of the successful WRITE_PLUS, the
write_response4 embedded in the operation will provide the necessary
information that a synchronous WRITE_PLUS would have provided.
Regardless of whether the operation is asynchronous or synchronous,
it MUST still support the COMMIT operation semantics as outlined in
Section 18.3 of [RFC5661]. I.e., COMMIT works on one or more WRITE
operations and the WRITE_PLUS operation can appear as several WRITE
operations to the server. The client can use locking operations to
control the behavior on the server with respect to long running
asynchronous write operations.
14.8. Operation 67: IO_ADVISE - Application I/O access pattern hints
14.8.1. ARGUMENT
14.7.1. ARGUMENT
enum IO_ADVISE_type4 { enum IO_ADVISE_type4 {
IO_ADVISE4_NORMAL = 0, IO_ADVISE4_NORMAL = 0,
IO_ADVISE4_SEQUENTIAL = 1, IO_ADVISE4_SEQUENTIAL = 1,
IO_ADVISE4_SEQUENTIAL_BACKWARDS = 2, IO_ADVISE4_SEQUENTIAL_BACKWARDS = 2,
IO_ADVISE4_RANDOM = 3, IO_ADVISE4_RANDOM = 3,
IO_ADVISE4_WILLNEED = 4, IO_ADVISE4_WILLNEED = 4,
IO_ADVISE4_WILLNEED_OPPORTUNISTIC = 5, IO_ADVISE4_WILLNEED_OPPORTUNISTIC = 5,
IO_ADVISE4_DONTNEED = 6, IO_ADVISE4_DONTNEED = 6,
IO_ADVISE4_NOREUSE = 7, IO_ADVISE4_NOREUSE = 7,
IO_ADVISE4_READ = 8, IO_ADVISE4_READ = 8,
skipping to change at page 75, line 31 skipping to change at page 69, line 26
}; };
struct IO_ADVISE4args { struct IO_ADVISE4args {
/* CURRENT_FH: file */ /* CURRENT_FH: file */
stateid4 iar_stateid; stateid4 iar_stateid;
offset4 iar_offset; offset4 iar_offset;
length4 iar_count; length4 iar_count;
bitmap4 iar_hints; bitmap4 iar_hints;
}; };
14.8.2. RESULT 14.7.2. RESULT
struct IO_ADVISE4resok { struct IO_ADVISE4resok {
bitmap4 ior_hints; bitmap4 ior_hints;
}; };
union IO_ADVISE4res switch (nfsstat4 _status) { union IO_ADVISE4res switch (nfsstat4 _status) {
case NFS4_OK: case NFS4_OK:
IO_ADVISE4resok resok4; IO_ADVISE4resok resok4;
default: default:
void; void;
}; };
14.8.3. DESCRIPTION 14.7.3. DESCRIPTION
The IO_ADVISE operation sends an I/O access pattern hint to the The IO_ADVISE operation sends an I/O access pattern hint to the
server for the owner of the stateid for a given byte range specified server for the owner of the stateid for a given byte range specified
by iar_offset and iar_count. The byte range specified by iar_offset by iar_offset and iar_count. The byte range specified by iar_offset
and iar_count need not currently exist in the file, but the iar_hints and iar_count need not currently exist in the file, but the iar_hints
will apply to the byte range when it does exist. If iar_count is 0, will apply to the byte range when it does exist. If iar_count is 0,
all data following iar_offset is specified. The server MAY ignore all data following iar_offset is specified. The server MAY ignore
the advice. the advice.
The following are the allowed hints for a stateid holder: The following are the allowed hints for a stateid holder:
skipping to change at page 77, line 30 skipping to change at page 71, line 25
perhaps due to a temporary resource limitation. perhaps due to a temporary resource limitation.
Each issuance of the IO_ADVISE operation overrides all previous Each issuance of the IO_ADVISE operation overrides all previous
issuances of IO_ADVISE for a given byte range. This effectively issuances of IO_ADVISE for a given byte range. This effectively
follows a strategy of last hint wins for a given stateid and byte follows a strategy of last hint wins for a given stateid and byte
range. range.
Clients should assume that hints included in an IO_ADVISE operation Clients should assume that hints included in an IO_ADVISE operation
will be forgotten once the file is closed. will be forgotten once the file is closed.
14.8.4. IMPLEMENTATION 14.7.4. IMPLEMENTATION
The NFS client may choose to issue an IO_ADVISE operation to the The NFS client may choose to issue an IO_ADVISE operation to the
server in several different instances. server in several different instances.
The most obvious is in direct response to an application's execution The most obvious is in direct response to an application's execution
of posix_fadvise(). In this case, IO_ADVISE4_WRITE and of posix_fadvise(). In this case, IO_ADVISE4_WRITE and
IO_ADVISE4_READ may be set based upon the type of file access IO_ADVISE4_READ may be set based upon the type of file access
specified when the file was opened. specified when the file was opened.
14.8.5. IO_ADVISE4_INIT_PROXIMITY 14.7.5. IO_ADVISE4_INIT_PROXIMITY
The IO_ADVISE4_INIT_PROXIMITY hint is non-posix in origin and conveys The IO_ADVISE4_INIT_PROXIMITY hint is non-posix in origin and conveys
that the client has recently accessed the byte range in its own that the client has recently accessed the byte range in its own
cache. I.e., it has not accessed it on the server, but it has cache. I.e., it has not accessed it on the server, but it has
locally. When the server reaches resource exhaustion, knowing which locally. When the server reaches resource exhaustion, knowing which
data is more important allows the server to make better choices about data is more important allows the server to make better choices about
which data to, for example purge from a cache, or move to secondary which data to, for example purge from a cache, or move to secondary
storage. It also informs the server which delegations are more storage. It also informs the server which delegations are more
important, since if delegations are working correctly, once delegated important, since if delegations are working correctly, once delegated
to a client and the client has read the content for that byte range, to a client and the client has read the content for that byte range,
a server might never receive another read request for that byte a server might never receive another read request for that byte
range. range.
This hint is also useful in the case of NFS clients which are network This hint is also useful in the case of NFS clients which are network
booting from a server. If the first client to be booted sends this booting from a server. If the first client to be booted sends this
hint, then it keeps the cache warm for the remaining clients. hint, then it keeps the cache warm for the remaining clients.
14.8.6. pNFS File Layout Data Type Considerations 14.7.6. pNFS File Layout Data Type Considerations
The IO_ADVISE considerations for pNFS are very similar to the COMMIT The IO_ADVISE considerations for pNFS are very similar to the COMMIT
considerations for pNFS. That is, as with COMMIT, some NFS server considerations for pNFS. That is, as with COMMIT, some NFS server
implementations prefer IO_ADVISE be done on the DS, and some prefer implementations prefer IO_ADVISE be done on the DS, and some prefer
it be done on the MDS. it be done on the MDS.
So for the file's layout type, it is proposed that NFSv4.2 include an So for the file's layout type, it is proposed that NFSv4.2 include an
additional hint NFL42_CARE_IO_ADVISE_THRU_MDS which is valid only on additional hint NFL42_CARE_IO_ADVISE_THRU_MDS which is valid only on
NFSv4.2 or higher. Any file's layout obtained with NFSv4.1 MUST NOT NFSv4.2 or higher. Any file's layout obtained with NFSv4.1 MUST NOT
have NFL42_UFLG_IO_ADVISE_THRU_MDS set. Any file's layout obtained have NFL42_UFLG_IO_ADVISE_THRU_MDS set. Any file's layout obtained
skipping to change at page 78, line 40 skipping to change at page 72, line 36
send an IO_ADVISE operation to the appropriate DS for the specified send an IO_ADVISE operation to the appropriate DS for the specified
byte range. While the client MAY always send IO_ADVISE to the MDS, byte range. While the client MAY always send IO_ADVISE to the MDS,
if the server has not set NFL42_UFLG_IO_ADVISE_THRU_MDS, the client if the server has not set NFL42_UFLG_IO_ADVISE_THRU_MDS, the client
should expect that such an IO_ADVISE is futile. Note that a client should expect that such an IO_ADVISE is futile. Note that a client
SHOULD use the same set of arguments on each IO_ADVISE sent to a DS SHOULD use the same set of arguments on each IO_ADVISE sent to a DS
for the same open file reference. for the same open file reference.
The server is not required to support different advice for different The server is not required to support different advice for different
DS's with the same open file reference. DS's with the same open file reference.
14.8.6.1. Dense and Sparse Packing Considerations 14.7.6.1. Dense and Sparse Packing Considerations
The IO_ADVISE operation MUST use the iar_offset and byte range as The IO_ADVISE operation MUST use the iar_offset and byte range as
dictated by the presence or absence of NFL4_UFLG_DENSE. dictated by the presence or absence of NFL4_UFLG_DENSE.
E.g., if NFL4_UFLG_DENSE is present, and a READ or WRITE to the DS E.g., if NFL4_UFLG_DENSE is present, and a READ or WRITE to the DS
for iar_offset 0 really means iar_offset 10000 in the logical file, for iar_offset 0 really means iar_offset 10000 in the logical file,
then an IO_ADVISE for iar_offset 0 means iar_offset 10000. then an IO_ADVISE for iar_offset 0 means iar_offset 10000.
E.g., if NFL4_UFLG_DENSE is absent, then a READ or WRITE to the DS E.g., if NFL4_UFLG_DENSE is absent, then a READ or WRITE to the DS
for iar_offset 0 really means iar_offset 0 in the logical file, then for iar_offset 0 really means iar_offset 0 in the logical file, then
skipping to change at page 80, line 10 skipping to change at page 74, line 7
If neither of the flags NFL42_UFLG_IO_ADVISE_THRU_MDS and If neither of the flags NFL42_UFLG_IO_ADVISE_THRU_MDS and
NFL4_UFLG_DENSE are set in the layout, then any IO_ADVISE request NFL4_UFLG_DENSE are set in the layout, then any IO_ADVISE request
sent to the data server with a byte range that overlaps stripe unit sent to the data server with a byte range that overlaps stripe unit
that the data server does not serve MUST NOT result in the status that the data server does not serve MUST NOT result in the status
NFS4ERR_PNFS_IO_HOLE. Instead, the response SHOULD be successful and NFS4ERR_PNFS_IO_HOLE. Instead, the response SHOULD be successful and
if the server applies IO_ADVISE hints on any stripe units that if the server applies IO_ADVISE hints on any stripe units that
overlap with the specified range, those hints SHOULD be indicated in overlap with the specified range, those hints SHOULD be indicated in
the response. the response.
14.9. Changes to Operation 51: LAYOUTRETURN 14.8. Changes to Operation 51: LAYOUTRETURN
14.9.1. Introduction 14.8.1. Introduction
In the pNFS description provided in [RFC5661], the client is not In the pNFS description provided in [RFC5661], the client is not
capable to relay an error code from the DS to the MDS. In the capable to relay an error code from the DS to the MDS. In the
specification of the Objects-Based Layout protocol [RFC5664], use is specification of the Objects-Based Layout protocol [RFC5664], use is
made of the opaque lrf_body field of the LAYOUTRETURN argument to do made of the opaque lrf_body field of the LAYOUTRETURN argument to do
such a relaying of error codes. In this section, we define a new such a relaying of error codes. In this section, we define a new
data structure to enable the passing of error codes back to the MDS data structure to enable the passing of error codes back to the MDS
and provide some guidelines on what both the client and MDS should and provide some guidelines on what both the client and MDS should
expect in such circumstances. expect in such circumstances.
skipping to change at page 81, line 6 skipping to change at page 75, line 5
it cannot determine if the client and DS path is working. As with it cannot determine if the client and DS path is working. As with
the case of the DS passing errors to the client, it must be prepared the case of the DS passing errors to the client, it must be prepared
for the MDS to consider such outages as being transitory. for the MDS to consider such outages as being transitory.
The existing LAYOUTRETURN operation is extended by introducing a new The existing LAYOUTRETURN operation is extended by introducing a new
data structure to report errors, layoutreturn_device_error4. Also, data structure to report errors, layoutreturn_device_error4. Also,
layoutreturn_device_error4 is introduced to enable an array of errors layoutreturn_device_error4 is introduced to enable an array of errors
to be reported. to be reported.
14.9.2. ARGUMENT 14.8.2. ARGUMENT
The ARGUMENT specification of the LAYOUTRETURN operation in section The ARGUMENT specification of the LAYOUTRETURN operation in section
18.44.1 of [RFC5661] is augmented by the following XDR code 18.44.1 of [RFC5661] is augmented by the following XDR code
[RFC4506]: [RFC4506]:
struct layoutreturn_device_error4 { struct layoutreturn_device_error4 {
deviceid4 lrde_deviceid; deviceid4 lrde_deviceid;
nfsstat4 lrde_status; nfsstat4 lrde_status;
nfs_opnum4 lrde_opnum; nfs_opnum4 lrde_opnum;
}; };
struct layoutreturn_error_report4 { struct layoutreturn_error_report4 {
layoutreturn_device_error4 lrer_errors<>; layoutreturn_device_error4 lrer_errors<>;
}; };
14.9.3. RESULT 14.8.3. RESULT
The RESULT of the LAYOUTRETURN operation is unchanged; see section The RESULT of the LAYOUTRETURN operation is unchanged; see section
18.44.2 of [RFC5661]. 18.44.2 of [RFC5661].
14.9.4. DESCRIPTION 14.8.4. DESCRIPTION
The following text is added to the end of the LAYOUTRETURN operation The following text is added to the end of the LAYOUTRETURN operation
DESCRIPTION in section 18.44.3 of [RFC5661]. DESCRIPTION in section 18.44.3 of [RFC5661].
When a client uses LAYOUTRETURN with a type of LAYOUTRETURN4_FILE, When a client uses LAYOUTRETURN with a type of LAYOUTRETURN4_FILE,
then if the lrf_body field is NULL, it indicates to the MDS that the then if the lrf_body field is NULL, it indicates to the MDS that the
client experienced no errors. If lrf_body is non-NULL, then the client experienced no errors. If lrf_body is non-NULL, then the
field references error information which is layout type specific. field references error information which is layout type specific.
I.e., the Objects-Based Layout protocol can continue to utilize I.e., the Objects-Based Layout protocol can continue to utilize
lrf_body as specified in [RFC5664]. For both Files-Based and Block- lrf_body as specified in [RFC5664]. For both Files-Based and Block-
skipping to change at page 82, line 9 skipping to change at page 76, line 5
Finally the NFS error value (nfsstat4) encountered is provided via Finally the NFS error value (nfsstat4) encountered is provided via
lrde_status and may consist of the following error codes: lrde_status and may consist of the following error codes:
NFS4ERR_NXIO: The client was unable to establish any communication NFS4ERR_NXIO: The client was unable to establish any communication
with the DS. with the DS.
NFS4ERR_*: The client was able to establish communication with the NFS4ERR_*: The client was able to establish communication with the
DS and is returning one of the allowed error codes for the DS and is returning one of the allowed error codes for the
operation denoted by lrde_opnum. operation denoted by lrde_opnum.
14.9.5. IMPLEMENTATION 14.8.5. IMPLEMENTATION
The following text is added to the end of the LAYOUTRETURN operation The following text is added to the end of the LAYOUTRETURN operation
IMPLEMENTATION in section 18.4.4 of [RFC5661]. IMPLEMENTATION in section 18.4.4 of [RFC5661].
Clients are expected to tolerate transient storage device errors, and Clients are expected to tolerate transient storage device errors, and
hence clients SHOULD NOT use the LAYOUTRETURN error handling for hence clients SHOULD NOT use the LAYOUTRETURN error handling for
device access problems that may be transient. The methods by which a device access problems that may be transient. The methods by which a
client decides whether a device access problem is transient vs. client decides whether a device access problem is transient vs.
persistent are implementation-specific, but may include retrying I/Os persistent are implementation-specific, but may include retrying I/Os
to a data server under appropriate conditions. to a data server under appropriate conditions.
skipping to change at page 82, line 34 skipping to change at page 76, line 30
and SHOULD indicate which storage device or devices was problematic. and SHOULD indicate which storage device or devices was problematic.
The client needs to do this when the DS is being unresponsive in The client needs to do this when the DS is being unresponsive in
order to fence off any failed write attempts, and ensure that they do order to fence off any failed write attempts, and ensure that they do
not end up overwriting any later data being written through the MDS. not end up overwriting any later data being written through the MDS.
If the client does not do this, the MDS MAY issue a layout recall If the client does not do this, the MDS MAY issue a layout recall
callback in order to perform the retried I/O. callback in order to perform the retried I/O.
The client needs to be cognizant that since this error handling is The client needs to be cognizant that since this error handling is
optional in the MDS, the MDS may silently ignore this functionality. optional in the MDS, the MDS may silently ignore this functionality.
Also, as the MDS may consider some issues the client reports to be Also, as the MDS may consider some issues the client reports to be
expected (see Section 14.9.1), the client might find it difficult to expected (see Section 14.8.1), the client might find it difficult to
detect a MDS which has not implemented error handling via detect a MDS which has not implemented error handling via
LAYOUTRETURN. LAYOUTRETURN.
If an MDS is aware that a storage device is proving problematic to a If an MDS is aware that a storage device is proving problematic to a
client, the MDS SHOULD NOT include that storage device in any pNFS client, the MDS SHOULD NOT include that storage device in any pNFS
layouts sent to that client. If the MDS is aware that a storage layouts sent to that client. If the MDS is aware that a storage
device is affecting many clients, then the MDS SHOULD NOT include device is affecting many clients, then the MDS SHOULD NOT include
that storage device in any pNFS layouts sent out. If a client asks that storage device in any pNFS layouts sent out. If a client asks
for a new layout for the file from the MDS, it MUST be prepared for for a new layout for the file from the MDS, it MUST be prepared for
the MDS to return that storage device in the layout. The MDS might the MDS to return that storage device in the layout. The MDS might
not have any choice in using the storage device, i.e., there might not have any choice in using the storage device, i.e., there might
only be one possible layout for the system. Also, in the case of only be one possible layout for the system. Also, in the case of
existing files, the MDS might have no choice in which storage devices existing files, the MDS might have no choice in which storage devices
to hand out to clients. to hand out to clients.
The MDS is not required to indefinitely retain per-client storage The MDS is not required to indefinitely retain per-client storage
device error information. An MDS is also not required to device error information. An MDS is also not required to
automatically reinstate use of a previously problematic storage automatically reinstate use of a previously problematic storage
device; administrative intervention may be required instead. device; administrative intervention may be required instead.
14.10. Operation 65: READ_PLUS 14.9. Operation 65: READ_PLUS
14.10.1. ARGUMENT 14.9.1. ARGUMENT
struct READ_PLUS4args { struct READ_PLUS4args {
/* CURRENT_FH: file */ /* CURRENT_FH: file */
stateid4 rpa_stateid; stateid4 rpa_stateid;
offset4 rpa_offset; offset4 rpa_offset;
count4 rpa_count; count4 rpa_count;
}; };
14.10.2. RESULT 14.9.2. RESULT
struct data_info4 { struct data_info4 {
offset4 di_offset; offset4 di_offset;
length4 di_length; length4 di_length;
bool di_allocated; bool di_allocated;
}; };
struct data4 { struct data4 {
offset4 d_offset; offset4 d_offset;
bool d_allocated; bool d_allocated;
skipping to change at page 84, line 30 skipping to change at page 78, line 30
read_plus_content rpr_contents<>; read_plus_content rpr_contents<>;
}; };
union READ_PLUS4res switch (nfsstat4 rp_status) { union READ_PLUS4res switch (nfsstat4 rp_status) {
case NFS4_OK: case NFS4_OK:
read_plus_res4 rp_resok4; read_plus_res4 rp_resok4;
default: default:
void; void;
}; };
14.10.3. DESCRIPTION 14.9.3. DESCRIPTION
The READ_PLUS operation is based upon the NFSv4.1 READ operation (see The READ_PLUS operation is based upon the NFSv4.1 READ operation (see
Section 18.22 of [RFC5661]) and similarly reads data from the regular Section 18.22 of [RFC5661]) and similarly reads data from the regular
file identified by the current filehandle. file identified by the current filehandle.
The client provides a rpa_offset of where the READ_PLUS is to start The client provides a rpa_offset of where the READ_PLUS is to start
and a rpa_count of how many bytes are to be read. A rpa_offset of and a rpa_count of how many bytes are to be read. A rpa_offset of
zero means to read data starting at the beginning of the file. If zero means to read data starting at the beginning of the file. If
rpa_offset is greater than or equal to the size of the file, the rpa_offset is greater than or equal to the size of the file, the
status NFS4_OK is returned with di_length (the data length) set to status NFS4_OK is returned with di_length (the data length) set to
skipping to change at page 86, line 23 skipping to change at page 80, line 23
For a READ_PLUS with a stateid value of all bits equal to zero, the For a READ_PLUS with a stateid value of all bits equal to zero, the
server MAY allow the READ_PLUS to be serviced subject to mandatory server MAY allow the READ_PLUS to be serviced subject to mandatory
byte-range locks or the current share deny modes for the file. For a byte-range locks or the current share deny modes for the file. For a
READ_PLUS with a stateid value of all bits equal to one, the server READ_PLUS with a stateid value of all bits equal to one, the server
MAY allow READ_PLUS operations to bypass locking checks at the MAY allow READ_PLUS operations to bypass locking checks at the
server. server.
On success, the current filehandle retains its value. On success, the current filehandle retains its value.
14.10.4. IMPLEMENTATION 14.9.4. IMPLEMENTATION
In general, the IMPLEMENTATION notes for READ in Section 18.22.4 of In general, the IMPLEMENTATION notes for READ in Section 18.22.4 of
[RFC5661] also apply to READ_PLUS. One delta is that when the owner [RFC5661] also apply to READ_PLUS. One delta is that when the owner
has a locked byte range, the server MUST return an array of has a locked byte range, the server MUST return an array of
rpr_contents with values inside that range. rpr_contents with values inside that range.
14.10.4.1. Additional pNFS Implementation Information 14.9.4.1. Additional pNFS Implementation Information
With pNFS, the semantics of using READ_PLUS remains the same. Any With pNFS, the semantics of using READ_PLUS remains the same. Any
data server MAY return a hole or ADH result for a READ_PLUS request data server MAY return a hole or ADH result for a READ_PLUS request
that it receives. When a data server chooses to return such a that it receives. When a data server chooses to return such a
result, it has the option of returning information for the data result, it has the option of returning information for the data
stored on that data server (as defined by the data layout), but it stored on that data server (as defined by the data layout), but it
MUST NOT return results for a byte range that includes data managed MUST NOT return results for a byte range that includes data managed
by another data server. by another data server.
A data server should do its best to return as much information about A data server should do its best to return as much information about
a ADH as is feasible without having to contact the metadata server. a ADH as is feasible without having to contact the metadata server.
If communication with the metadata server is required, then every If communication with the metadata server is required, then every
attempt should be taken to minimize the number of requests. attempt should be taken to minimize the number of requests.
If mandatory locking is enforced, then the data server must also If mandatory locking is enforced, then the data server must also
ensure that to return only information that is within the owner's ensure that to return only information that is within the owner's
locked byte range. locked byte range.
14.10.5. READ_PLUS with Sparse Files Example 14.9.5. READ_PLUS with Sparse Files Example
The following table describes a sparse file. For each byte range, The following table describes a sparse file. For each byte range,
the file contains either non-zero data or a hole. In addition, the the file contains either non-zero data or a hole. In addition, the
server in this example uses a Hole Threshold of 32K. server in this example uses a Hole Threshold of 32K.
+-------------+----------+ +-------------+----------+
| Byte-Range | Contents | | Byte-Range | Contents |
+-------------+----------+ +-------------+----------+
| 0-15999 | Hole | | 0-15999 | Hole |
| 16K-31999 | Non-Zero | | 16K-31999 | Non-Zero |
skipping to change at page 88, line 5 skipping to change at page 82, line 5
the client was requesting. the client was requesting.
3. READ_PLUS(s, 256K, 64K) --> NFS_OK, eof = false, <data[256K, 3. READ_PLUS(s, 256K, 64K) --> NFS_OK, eof = false, <data[256K,
288K], hole[288K, 354K]>. Returns an array of the 32K data and 288K], hole[288K, 354K]>. Returns an array of the 32K data and
the hole which extends to 354K. the hole which extends to 354K.
4. READ_PLUS(s, 354K, 64K) --> NFS_OK, eof = true, <data[354K, 4. READ_PLUS(s, 354K, 64K) --> NFS_OK, eof = true, <data[354K,
418K]>. Returns the final 64K of data and informs the client 418K]>. Returns the final 64K of data and informs the client
there is no more data in the file. there is no more data in the file.
14.11. Operation 66: SEEK 14.10. Operation 66: SEEK
SEEK is an operation that allows a client to determine the location SEEK is an operation that allows a client to determine the location
of the next data_content4 in a file. It allows an implementation of of the next data_content4 in a file. It allows an implementation of
the emerging extension to lseek(2) to allow clients to determine the emerging extension to lseek(2) to allow clients to determine
SEEK_HOLE and SEEK_DATA. SEEK_HOLE and SEEK_DATA.
14.11.1. ARGUMENT 14.10.1. ARGUMENT
struct SEEK4args { struct SEEK4args {
/* CURRENT_FH: file */ /* CURRENT_FH: file */
stateid4 sa_stateid; stateid4 sa_stateid;
offset4 sa_offset; offset4 sa_offset;
data_content4 sa_what; data_content4 sa_what;
}; };
14.11.2. RESULT 14.10.2. RESULT
union seek_content switch (data_content4 content) { union seek_content switch (data_content4 content) {
case NFS4_CONTENT_DATA: case NFS4_CONTENT_DATA:
data_info4 sc_data; data_info4 sc_data;
case NFS4_CONTENT_APP_DATA_HOLE: case NFS4_CONTENT_APP_DATA_HOLE:
app_data_hole4 sc_adh; app_data_hole4 sc_adh;
case NFS4_CONTENT_HOLE: case NFS4_CONTENT_HOLE:
data_info4 sc_hole; data_info4 sc_hole;
default: default:
void; void;
skipping to change at page 88, line 46 skipping to change at page 82, line 46
seek_content sr_contents; seek_content sr_contents;
}; };
union SEEK4res switch (nfsstat4 status) { union SEEK4res switch (nfsstat4 status) {
case NFS4_OK: case NFS4_OK:
seek_res4 resok4; seek_res4 resok4;
default: default:
void; void;
}; };
14.11.3. DESCRIPTION 14.10.3. DESCRIPTION
From the given sa_offset, find the next data_content4 of type sa_what From the given sa_offset, find the next data_content4 of type sa_what
in the file. For either a hole or ADH, this must return the in the file. For either a hole or ADH, this must return the
data_content4 in its entirety. For data, it must not return the data_content4 in its entirety. For data, it must not return the
actual data. actual data.
SEEK must follow the same rules for stateids as READ_PLUS SEEK must follow the same rules for stateids as READ_PLUS
(Section 14.10.3). (Section 14.9.3).
If the server could not find a corresponding sa_what, then the status If the server could not find a corresponding sa_what, then the status
would still be NFS4_OK, but sr_eof would be TRUE. The sr_contents would still be NFS4_OK, but sr_eof would be TRUE. The sr_contents
would contain a zero-ed out content of the appropriate type. would contain a zero-ed out content of the appropriate type.
14.11. Operation 64: WRITE_HOLE
14.11.1. ARGUMENT
struct data_info4 {
offset4 di_offset;
length4 di_length;
bool di_allocated;
};
struct WRITE_HOLE4args {
/* CURRENT_FH: file */
stateid4 wh_stateid;
stable_how4 wh_stable;
data_info4 wh_hole;
};
14.11.2. RESULT
struct write_response4 {
stateid4 wr_callback_id<1>;
length4 wr_count;
stable_how4 wr_committed;
verifier4 wr_writeverf;
};
union WRITE_HOLE4res switch (nfsstat4 wh_status) {
case NFS4_OK:
write_response4 wh_resok4;
default:
void;
};
14.11.3. DESCRIPTION
The WRITE_HOLE operation is an extension of the NFSv4.1 WRITE
operation (see Section 18.2 of [RFC5661]) and writes holes to the
regular file identified by the current filehandle. The server MAY
write fewer bytes than requested by the client.
A successful WRITE_HOLE will construct a reply for wr_count,
wr_committed, and wr_writeverf as per the NFSv4.1 WRITE operation
results. If wr_callback_id is set, it indicates an asynchronous
reply (see Section 14.11.3.2).
WRITE_HOLE has to support all of the errors which are returned by
WRITE plus NFS4ERR_NOTSUPP, i.e., it is an OPTIONAL operation. If
the client supports WRITE_HOLE, it MUST support CB_OFFLOAD.
14.11.3.1. Hole punching
Whenever a client wishes to zero the blocks backing a particular
region in the file, it calls the WRITE_HOLE operation with the
current filehandle set to the filehandle of the file in question, and
the equivalent of start offset and length in bytes of the region set
in wh_hole.di_offset and wh_hole.di_length respectively. If the
wh_hole.di_allocated is set to TRUE, then the blocks will be zeroed
and if it is set to FALSE, then they will be deallocated. All
further reads to this region MUST return zeros until overwritten.
The filehandle specified must be that of a regular file.
Situations may arise where di_offset and/or di_offset + di_length
will not be aligned to a boundary for which the server does
allocations/deallocations. For most file systems, this is the block
size of the file system. In such a case, the server can deallocate
as many bytes as it can in the region. The blocks that cannot be
deallocated MUST be zeroed. Except for the block deallocation and
maximum hole punching capability, a WRITE_HOLE operation is to be
treated similar to a write of zeroes.
The server is not required to complete deallocating the blocks
specified in the operation before returning. The server SHOULD
return an asynchronous result if it can determine the operation will
be long running (see Section 14.11.3.2).
If used to hole punch, WRITE_HOLE will result in the space_used
attribute being decreased by the number of bytes that were
deallocated. The space_freed attribute may or may not decrease,
depending on the support and whether the blocks backing the specified
range were shared or not. The size attribute will remain unchanged.
The WRITE_HOLE operation MUST NOT change the space reservation
guarantee of the file. While the server can deallocate the blocks
specified by di_offset and di_length, future writes to this region
MUST NOT fail with NFSERR_NOSPC.
14.11.3.2. Asynchronous Transactions
Hole punching may lead to server determining to service the operation
asynchronously. If it decides to do so, it sets the stateid in
wr_callback_id to be that of the wh_stateid. If it does not set the
wr_callback_id, then the result is synchronous.
When the client determines that the reply will be given
asynchronously, it should not assume anything about the contents of
what it wrote until it is informed by the server that the operation
is complete. It can use OFFLOAD_STATUS (Section 14.5) to monitor the
operation and OFFLOAD_ABORT (Section 14.2) to cancel the operation.
An example of a asynchronous WRITE_HOLE is shown in Figure 6. Note
that as with the COPY operation, WRITE_HOLE must provide a stateid
for tracking the asynchronous operation.
Client Server
+ +
| |
|--- OPEN ---------------------------->| Client opens
|<------------------------------------/| the file
| |
|--- WRITE_HOLE ---------------------->| Client punches
|<------------------------------------/| a hole
| |
| |
|--- OFFLOAD_STATUS ------------------>| Client may poll
|<------------------------------------/| for status
| |
| . | Multiple OFFLOAD_STATUS
| . | operations may be sent.
| . |
| |
|<-- CB_OFFLOAD -----------------------| Server reports results
|\------------------------------------>|
| |
|--- CLOSE --------------------------->| Client closes
|<------------------------------------/| the file
| |
| |
Figure 6: An asynchronous WRITE_HOLE.
When CB_OFFLOAD informs the client of the successful WRITE_HOLE, the
write_response4 embedded in the operation will provide the necessary
information that a synchronous WRITE_HOLE would have provided.
Regardless of whether the operation is asynchronous or synchronous,
it MUST still support the COMMIT operation semantics as outlined in
Section 18.3 of [RFC5661]. I.e., COMMIT works on one or more WRITE
operations and the WRITE_HOLE operation can appear as several WRITE
operations to the server. The client can use locking operations to
control the behavior on the server with respect to long running
asynchronous write operations.
14.12. Operation 68: WRITE_SAME
14.12.1. ARGUMENT
struct data_info4 {
offset4 di_offset;
length4 di_length;
bool di_allocated;
};
struct WRITE_SAME4args {
/* CURRENT_FH: file */
stateid4 ws_stateid;
stable_how4 ws_stable;
app_data_hole4 ws_adh;
};
14.12.2. RESULT
struct write_response4 {
stateid4 wr_callback_id<1>;
length4 wr_count;
stable_how4 wr_committed;
verifier4 wr_writeverf;
};
union WRITE_SAME4res switch (nfsstat4 ws_status) {
case NFS4_OK:
write_response4 ws_resok4;
default:
void;
};
14.12.3. DESCRIPTION
The WRITE_SAME operation is an extension of the NFSv4.1 WRITE
operation (see Section 18.2 of [RFC5661]) and writes data to the
regular file identified by the current filehandle. The server MAY
write fewer bytes than requested by the client.
The WRITE_SAME argument is comprised of an array of rpr_contents,
each of which describe a data_content4 type of data (Section 7.1.2).
For NFSv4.2, the allowed values are data, ADH, and hole. The array
contents MUST be contiguous in the file. A successful WRITE_SAME
will construct a reply for wr_count, wr_committed, and wr_writeverf
as per the NFSv4.1 WRITE operation results. If wr_callback_id is
set, it indicates an asynchronous reply (see Section 14.12.3.2).
WRITE_SAME has to support all of the errors which are returned by
WRITE plus NFS4ERR_NOTSUPP, i.e., it is an OPTIONAL operation. If
the client supports WRITE_SAME, it MUST support CB_OFFLOAD.
14.12.3.1. ADHs
If the server supports ADHs, then it MUST support the WRITE_SAME
operation. The server has no concept of the structure imposed by the
application. It is only when the application writes to a section of
the file does order get imposed. In order to detect corruption even
before the application utilizes the file, the application will want
to initialize a range of ADHs using WRITE_SAME.
For ADHs, when the client invokes the WRITE_SAME operation, it has
two desired results:
1. The structure described by the app_data_block4 be imposed on the
file.
2. The contents described by the app_data_block4 be sparse.
If the server supports the WRITE_SAME operation, it still might not
support sparse files. So if it receives the WRITE_SAME operation,
then it MUST populate the contents of the file with the initialized
ADHs. The server SHOULD return an asynchronous result if it can
determine the operation will be long running (see Section 14.12.3.2).
If the data was already initialized, there are two interesting
scenarios:
1. The data blocks are allocated.
2. Initializing in the middle of an existing ADH.
If the data blocks were already allocated, then the WRITE_SAME is a
hole punch operation. If WRITE_SAME supports sparse files, then the
data blocks are to be deallocated. If not, then the data blocks are
to be rewritten in the indicated ADH format.
Since the server has no knowledge of ADHs, it should not report
misaligned creation of ADHs. Even while it can detect them, it
cannot disallow them, as the application might be in the process of
changing the size of the ADHs. Thus the server must be prepared to
handle an WRITE_SAME into an existing ADH.
This document does not mandate the manner in which the server stores
ADHs sparsely for a file. However, if an WRITE_SAME arrives that
will force a new ADH to start inside an existing ADH then the server
will have three ADHs instead of two. It will have one up to the new
one for the WRITE_SAME, one for the WRITE_SAME, and one for after the
WRITE_SAME. Note that depending on server specific policies for
block allocation, there may also be some physical blocks allocated to
align the boundaries.
14.12.3.2. Asynchronous Transactions
ADH initialization may lead to server determining to service the
operation asynchronously. If it decides to do so, it sets the
stateid in wr_callback_id to be that of the ws_stateid. If it does
not set the wr_callback_id, then the result is synchronous.
When the client determines that the reply will be given
asynchronously, it should not assume anything about the contents of
what it wrote until it is informed by the server that the operation
is complete. It can use OFFLOAD_STATUS (Section 14.5) to monitor the
operation and OFFLOAD_ABORT (Section 14.2) to cancel the operation.
An example of a asynchronous WRITE_SAME is shown in Figure 7. Note
that as with the COPY operation, WRITE_SAME must provide a stateid
for tracking the asynchronous operation.
Client Server
+ +
| |
|--- OPEN ---------------------------->| Client opens
|<------------------------------------/| the file
| |
|--- WRITE_SAME ---------------------->| Client initializes
|<------------------------------------/| an ADH
| |
| |
|--- OFFLOAD_STATUS ------------------>| Client may poll
|<------------------------------------/| for status
| |
| . | Multiple OFFLOAD_STATUS
| . | operations may be sent.
| . |
| |
|<-- CB_OFFLOAD -----------------------| Server reports results
|\------------------------------------>|
| |
|--- CLOSE --------------------------->| Client closes
|<------------------------------------/| the file
| |
| |
Figure 7: An asynchronous WRITE_SAME.
When CB_OFFLOAD informs the client of the successful WRITE_SAME, the
write_response4 embedded in the operation will provide the necessary
information that a synchronous WRITE_SAME would have provided.
Regardless of whether the operation is asynchronous or synchronous,
it MUST still support the COMMIT operation semantics as outlined in
Section 18.3 of [RFC5661]. I.e., COMMIT works on one or more WRITE
operations and the WRITE_SAME operation can appear as several WRITE
operations to the server. The client can use locking operations to
control the behavior on the server with respect to long running
asynchronous write operations.
15. NFSv4.2 Callback Operations 15. NFSv4.2 Callback Operations
15.1. Operation 15: CB_OFFLOAD - Report results of an asynchronous 15.1. Operation 15: CB_OFFLOAD - Report results of an asynchronous
operation operation
15.1.1. ARGUMENT 15.1.1. ARGUMENT
struct write_response4 { struct write_response4 {
stateid4 wr_callback_id<1>; stateid4 wr_callback_id<1>;
count4 wr_count; length4 wr_count;
stable_how4 wr_committed; stable_how4 wr_committed;
verifier4 wr_writeverf; verifier4 wr_writeverf;
}; };
union offload_info4 switch (nfsstat4 coa_status) { union offload_info4 switch (nfsstat4 coa_status) {
case NFS4_OK: case NFS4_OK:
write_response4 coa_resok4; write_response4 coa_resok4;
default: default:
length4 coa_bytes_copied; length4 coa_bytes_copied;
}; };
skipping to change at page 90, line 14 skipping to change at page 90, line 48
indicates success or failure. The coa_resok4.wr_callback_id MUST NOT indicates success or failure. The coa_resok4.wr_callback_id MUST NOT
be set. If the transaction failed, then the coa_bytes_copied be set. If the transaction failed, then the coa_bytes_copied
contains the number of bytes copied before the failure occurred. The contains the number of bytes copied before the failure occurred. The
coa_bytes_copied value indicates the number of bytes copied but not coa_bytes_copied value indicates the number of bytes copied but not
which specific bytes have been copied. which specific bytes have been copied.
If the client supports either If the client supports either
1. the COPY operation 1. the COPY operation
2. the WRITE_PLUS operation and any arm of the discriminated union 2. either the WRITE_HOLE or WRITE_SAME operations
other than NFS4_CONTENT_DATA
then the client is REQUIRED to support the CB_OFFLOAD operation. then the client is REQUIRED to support the CB_OFFLOAD operation.
There is a potential race between the reply to the original There is a potential race between the reply to the original
transaction on the forechannel and the CB_OFFLOAD callback on the transaction on the forechannel and the CB_OFFLOAD callback on the
backchannel. Sections 2.10.6.3 and 20.9.3 of [RFC5661] describe how backchannel. Sections 2.10.6.3 and 20.9.3 of [RFC5661] describe how
to handle this type of issue. to handle this type of issue.
15.1.3.1. Server-side Copy 15.1.3.1. Server-side Copy
CB_OFFLOAD is used for both intra- and inter-server asynchronous CB_OFFLOAD is used for both intra- and inter-server asynchronous
copies. This operation is sent by the destination server to the copies. This operation is sent by the destination server to the
client in a CB_COMPOUND request. Upon success, the client in a CB_COMPOUND request. Upon success, the
coa_resok4.wr_count presents the total number of bytes copied. coa_resok4.wr_count presents the total number of bytes copied.
15.1.3.2. WRITE_PLUS 15.1.3.2. WRITE_HOLE and WRITE_SAME
CB_OFFLOAD is used to report the completion of either a hole punch or CB_OFFLOAD is used to report the completion of either a hole punch or
an ADH initialization. Upon success, the coa_resok4 will contain the an ADH initialization. Upon success, the coa_resok4 will contain the
same information that a synchronous WRITE_PLUS would have returned. same information that the corresponding synchronous WRITE_HOLE or
WRITE_SAME would have returned.
16. IANA Considerations 16. IANA Considerations
This section uses terms that are defined in [RFC5226]. This section uses terms that are defined in [RFC5226].
17. References 17. References
17.1. Normative References 17.1. Normative References
[NFSv42xdr] [NFSv42xdr]
Haynes, T., "Network File System (NFS) Version 4 Minor Haynes, T., "Network File System (NFS) Version 4 Minor
Version 2 External Data Representation Standard (XDR) Version 2 External Data Representation Standard (XDR)
Description", March 2013. Description", April 2014.
[RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform [RFC3986] Berners-Lee, T., Fielding, R., and L. Masinter, "Uniform
Resource Identifier (URI): Generic Syntax", STD 66, Resource Identifier (URI): Generic Syntax", STD 66, RFC
RFC 3986, January 2005. 3986, January 2005.
[RFC5661] Shepler, S., Eisler, M., and D. Noveck, "Network File [RFC5661] Shepler, S., Eisler, M., and D. Noveck, "Network File
System (NFS) Version 4 Minor Version 1 Protocol", System (NFS) Version 4 Minor Version 1 Protocol", RFC
RFC 5661, January 2010. 5661, January 2010.
[RFC5664] Halevy, B., Welch, B., and J. Zelenka, "Object-Based [RFC5664] Halevy, B., Welch, B., and J. Zelenka, "Object-Based
Parallel NFS (pNFS) Operations", RFC 5664, January 2010. Parallel NFS (pNFS) Operations", RFC 5664, January 2010.
[posix_fadvise] [posix_fadvise]
The Open Group, "Section 'posix_fadvise()' of System The Open Group, "Section 'posix_fadvise()' of System
Interfaces of The Open Group Base Specifications Issue 6, Interfaces of The Open Group Base Specifications Issue 6,
IEEE Std 1003.1, 2004 Edition", 2004. IEEE Std 1003.1, 2004 Edition", 2004.
[rpcsec_gssv3] [rpcsec_gssv3]
skipping to change at page 91, line 46 skipping to change at page 92, line 30
'08) , 2008. '08) , 2008.
[FEDFS-ADMIN] [FEDFS-ADMIN]
Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M. Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M.
Naik, "Administration Protocol for Federated Filesystems", Naik, "Administration Protocol for Federated Filesystems",
draft-ietf-nfsv4-federated-fs-admin (Work In Progress), draft-ietf-nfsv4-federated-fs-admin (Work In Progress),
2010. 2010.
[FEDFS-NSDB] [FEDFS-NSDB]
Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M. Lentini, J., Everhart, C., Ellard, D., Tewari, R., and M.
Naik, "NSDB Protocol for Federated Filesystems", Naik, "NSDB Protocol for Federated Filesystems", draft-
draft-ietf-nfsv4-federated-fs-protocol (Work In Progress), ietf-nfsv4-federated-fs-protocol (Work In Progress), 2010.
2010.
[Haynes13] [Haynes13]
Haynes, T., "Requirements for Labeled NFS", Haynes, T., "Requirements for Labeled NFS", draft-ietf-
draft-ietf-nfsv4-labreqs-04 (work in progress), 2013. nfsv4-labreqs-04 (work in progress), 2013.
[I-D.ietf-nfsv4-rfc3530bis] [I-D.ietf-nfsv4-rfc3530bis]
Haynes, T. and D. Noveck, "Network File System (NFS) Haynes, T. and D. Noveck, "Network File System (NFS)
version 4 Protocol", draft-ietf-nfsv4-rfc3530bis-25 (Work version 4 Protocol", draft-ietf-nfsv4-rfc3530bis-25 (Work
In Progress), February 2013. In Progress), February 2013.
[IESG08] ISEG, "IESG Processing of RFC Errata for the IETF Stream", [IESG08] ISEG, "IESG Processing of RFC Errata for the IETF Stream",
2008. 2008.
[MLS] "Section 46.6. Multi-Level Security (MLS) of Deployment [MLS] "Section 46.6. Multi-Level Security (MLS) of Deployment
Guide: Deployment, configuration and administration of Red Guide: Deployment, configuration and administration of Red
Hat Enterprise Linux 5, Edition 6", 2011. Hat Enterprise Linux 5, Edition 6", 2011.
[McDougall07] [McDougall07]
McDougall, R. and J. Mauro, "Section 11.4.3, Detecting McDougall, R. and J. Mauro, "Section 11.4.3, Detecting
Memory Corruption of Solaris Internals", 2007. Memory Corruption of Solaris Internals", 2007.
[Quigley11] [Quigley11]
Quigley, D. and J. Lu, "Registry Specification for MAC Quigley, D. and J. Lu, "Registry Specification for MAC
Security Label Formats", Security Label Formats", draft-quigley-label-format-
draft-quigley-label-format-registry (work in progress), registry (work in progress), 2011.
2011.
[RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", [RFC0959] Postel, J. and J. Reynolds, "File Transfer Protocol", STD
STD 9, RFC 959, October 1985. 9, RFC 959, October 1985.
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", March 1997. Requirement Levels", March 1997.
[RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H., [RFC2616] Fielding, R., Gettys, J., Mogul, J., Frystyk, H.,
Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext Masinter, L., Leach, P., and T. Berners-Lee, "Hypertext
Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999. Transfer Protocol -- HTTP/1.1", RFC 2616, June 1999.
[RFC4506] Eisler, M., "XDR: External Data Representation Standard", [RFC4506] Eisler, M., "XDR: External Data Representation Standard",
RFC 4506, May 2006. RFC 4506, May 2006.
skipping to change at page 92, line 51 skipping to change at page 93, line 34
IANA Considerations Section in RFCs", BCP 26, RFC 5226, IANA Considerations Section in RFCs", BCP 26, RFC 5226,
May 2008. May 2008.
[Strohm11] [Strohm11]
Strohm, R., "Chapter 2, Data Blocks, Extents, and Strohm, R., "Chapter 2, Data Blocks, Extents, and
Segments, of Oracle Database Concepts 11g Release 1 Segments, of Oracle Database Concepts 11g Release 1
(11.1)", January 2011. (11.1)", January 2011.
Appendix A. Acknowledgments Appendix A. Acknowledgments
Tom Haynes would like to thank NetApp, Inc. for its funding of his
time on this project.
For the pNFS Access Permissions Check, the original draft was by For the pNFS Access Permissions Check, the original draft was by
Sorin Faibish, David Black, Mike Eisler, and Jason Glasgow. The work Sorin Faibish, David Black, Mike Eisler, and Jason Glasgow. The work
was influenced by discussions with Benny Halevy and Bruce Fields. A was influenced by discussions with Benny Halevy and Bruce Fields. A
review was done by Tom Haynes. review was done by Tom Haynes.
For the Sharing change attribute implementation details with NFSv4 For the Sharing change attribute implementation details with NFSv4
clients, the original draft was by Trond Myklebust. clients, the original draft was by Trond Myklebust.
For the NFS Server-side Copy, the original draft was by James For the NFS Server-side Copy, the original draft was by James
Lentini, Mike Eisler, Deepak Kenchammana, Anshul Madan, and Rahul Lentini, Mike Eisler, Deepak Kenchammana, Anshul Madan, and Rahul
skipping to change at page 93, line 49 skipping to change at page 94, line 34
reviewers were Andy Adamson, Pranoop Erasani, Bruce Fields, Chuck reviewers were Andy Adamson, Pranoop Erasani, Bruce Fields, Chuck
Lever, Trond Myklebust, David Noveck, Peter Staubach, and Mike Lever, Trond Myklebust, David Noveck, Peter Staubach, and Mike
Kupfer. Kupfer.
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 NFSv42xdr with RFCxxxx where xxxx is the
RFC number of this document] RFC number of the companion XDR document]
Author's Address Author's Address
Thomas Haynes (editor) Thomas Haynes (editor)
NetApp PrimaryData, Inc.
495 E Java Dr 4300 El Camino Real Ste 100
Sunnyvale, CA 95054 Los Altos, CA 94022
USA USA
Phone: +1 408 419 3018 Phone: +1 408 215 1519
Email: thomas@netapp.com Email: thomas.haynes@primarydata.com
 End of changes. 75 change blocks. 
440 lines changed or deleted 527 lines changed or added

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