draft-ietf-nfsv4-xattrs-06.txt   draft-ietf-nfsv4-xattrs-07.txt 
NFSv4 Working Group M. Naik NFSv4 Working Group M. Naik
Internet Draft Nutanix Internet Draft Nutanix
Intended Status: Standards Track M. Eshel Intended Status: Standards Track M. Eshel
Expires: January 31, 2018 IBM Almaden Expires: February 23, 2018 IBM Almaden
July 30, 2017 August 22, 2017
File System Extended Attributes in NFSv4 File System Extended Attributes in NFSv4
draft-ietf-nfsv4-xattrs-06 draft-ietf-nfsv4-xattrs-07
Abstract Abstract
This document describes an OPTIONAL feature extending the NFSv4 This document describes an OPTIONAL feature extending the NFSv4
protocol which allows extended attributes (hereinafter also referred protocol which allows extended attributes (hereinafter also referred
to as xattrs) to be interrogated and manipulated using NFSv4 clients. to as xattrs) to be interrogated and manipulated using NFSv4 clients.
Xattrs are provided by a file system to associate opaque metadata, Xattrs are provided by a file system to associate opaque metadata,
not interpreted by the file system, with files and directories. Such not interpreted by the file system, with files and directories. Such
support is present in many modern local file systems. New file support is present in many modern local file systems. New file
attributes are provided to allow clients to query the server for attributes are provided to allow clients to query the server for
skipping to change at page 2, line 48 skipping to change at page 2, line 48
8.4.1. GETXATTR - Get an extended attribute of a file . . . . 13 8.4.1. GETXATTR - Get an extended attribute of a file . . . . 13
8.4.2. SETXATTR - Set an extended attribute of a file . . . . 14 8.4.2. SETXATTR - Set an extended attribute of a file . . . . 14
8.4.3. LISTXATTRS - List extended attributes of a file . . . 16 8.4.3. LISTXATTRS - List extended attributes of a file . . . 16
8.4.4. REMOVEXATTR - Remove an extended attribute of a file . 18 8.4.4. REMOVEXATTR - Remove an extended attribute of a file . 18
8.4.5. Valid Errors . . . . . . . . . . . . . . . . . . . . . 19 8.4.5. Valid Errors . . . . . . . . . . . . . . . . . . . . . 19
8.5. Modifications to Existing Operations . . . . . . . . . . . 20 8.5. Modifications to Existing Operations . . . . . . . . . . . 20
8.6. Numeric Values Assigned to Protocol Extensions . . . . . . 21 8.6. Numeric Values Assigned to Protocol Extensions . . . . . . 21
8.7. Caching . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.7. Caching . . . . . . . . . . . . . . . . . . . . . . . . . 22
8.8. Xattrs and File Locking . . . . . . . . . . . . . . . . . 24 8.8. Xattrs and File Locking . . . . . . . . . . . . . . . . . 24
8.9. pNFS Considerations . . . . . . . . . . . . . . . . . . . 24 8.9. pNFS Considerations . . . . . . . . . . . . . . . . . . . 24
9. Security Considerations . . . . . . . . . . . . . . . . . . . 24 9. Security Considerations . . . . . . . . . . . . . . . . . . . 25
10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 24 10. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 25
11. References . . . . . . . . . . . . . . . . . . . . . . . . . 26 11. References . . . . . . . . . . . . . . . . . . . . . . . . . 26
11.1. Normative References . . . . . . . . . . . . . . . . . . 26 11.1. Normative References . . . . . . . . . . . . . . . . . . 26
11.2. Informative References . . . . . . . . . . . . . . . . . 27 11.2. Informative References . . . . . . . . . . . . . . . . . 27
Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 27 Appendix A. Acknowledgements . . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 28 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 28
1. Introduction 1. Introduction
Extended attributes, also called xattrs, are a means to associate Extended attributes, also called xattrs, are a means to associate
opaque metadata with file system objects, organized as key/value opaque metadata with file system objects, organized as key/value
skipping to change at page 12, line 28 skipping to change at page 12, line 28
exchanged between the client and server for get/set operations is exchanged between the client and server for get/set operations is
limited by the channel's negotiated maximum size for requests and limited by the channel's negotiated maximum size for requests and
responses. responses.
8.3. New Error Definitions 8.3. New Error Definitions
<CODE BEGINS> <CODE BEGINS>
/// /* Following lines are to be added to enum nfsstat4 */ /// /* Following lines are to be added to enum nfsstat4 */
/// /* /// /*
/// NFS4ERR_NOXATTR = 10095 /* xattr does not exist */ /// NFS4ERR_NOXATTR = 10095, /* xattr does not exist */
/// NFS4ERR_XATTR2BIG = 10096 /* xattr value is too big */ /// NFS4ERR_XATTR2BIG = 10096 /* xattr value is too big */
/// */ /// */
<CODE ENDS> <CODE ENDS>
8.3.1. NFS4ERR_NOXATTR (Error Code 10095) 8.3.1. NFS4ERR_NOXATTR (Error Code 10095)
The specified xattr does not exist or the server is unable to The specified xattr does not exist or the server is unable to
retrieve it. retrieve it.
8.3.2. NFS4ERR_XATTR2BIG (Error Code 10096) 8.3.2. NFS4ERR_XATTR2BIG (Error Code 10096)
skipping to change at page 15, line 11 skipping to change at page 15, line 11
for details. for details.
8.4.2. SETXATTR - Set an extended attribute of a file 8.4.2. SETXATTR - Set an extended attribute of a file
8.4.2.1. ARGUMENTS 8.4.2.1. ARGUMENTS
<CODE BEGINS> <CODE BEGINS>
/// enum setxattr_option4 { /// enum setxattr_option4 {
/// SETXATTR4_EITHER = 0, /// SETXATTR4_EITHER = 0,
/// SETXATTR4_CREATE = 1, /// SETXATTR4_CREATE = 1,
/// SETXATTR4_REPLACE = 2, /// SETXATTR4_REPLACE = 2
/// }; /// };
/// struct SETXATTR4args { /// struct SETXATTR4args {
/// /* CURRENT_FH: file */ /// /* CURRENT_FH: file */
/// setxattr_option4 sxa_option; /// setxattr_option4 sxa_option;
/// xattrkey4 sxa_key; /// xattrkey4 sxa_key;
/// xattrvalue4 sxa_value; /// xattrvalue4 sxa_value;
/// }; /// };
<CODE ENDS> <CODE ENDS>
8.4.2.2. RESULTS 8.4.2.2. RESULTS
<CODE BEGINS> <CODE BEGINS>
/// struct SETXATTR4res switch (nfsstat4 sxr_status) { /// union SETXATTR4res switch (nfsstat4 sxr_status) {
/// case NFS4_OK: /// case NFS4_OK:
/// change_info4 sxr_info; /// change_info4 sxr_info;
/// default: /// default:
/// void; /// void;
/// }; /// };
<CODE ENDS> <CODE ENDS>
8.4.2.3. DESCRIPTION 8.4.2.3. DESCRIPTION
skipping to change at page 18, line 32 skipping to change at page 18, line 32
/// /* CURRENT_FH: file */ /// /* CURRENT_FH: file */
/// xattrkey4 rxa_name; /// xattrkey4 rxa_name;
/// }; /// };
<CODE ENDS> <CODE ENDS>
8.4.4.2. RESULTS 8.4.4.2. RESULTS
<CODE BEGINS> <CODE BEGINS>
/// struct REMOVEXATTR4res switch (nfsstat4 rxr_status) { /// union REMOVEXATTR4res switch (nfsstat4 rxr_status) {
/// case NFS4_OK: /// case NFS4_OK:
/// change_info4 rxr_info; /// change_info4 rxr_info;
/// default: /// default:
/// void; /// void;
/// }; /// };
<CODE ENDS> <CODE ENDS>
8.4.4.3. DESCRIPTION 8.4.4.3. DESCRIPTION
skipping to change at page 19, line 36 skipping to change at page 19, line 36
Valid Error Returns for Each New Protocol Operation Valid Error Returns for Each New Protocol Operation
+----------------------+--------------------------------------------+ +----------------------+--------------------------------------------+
| Operation | Errors | | Operation | Errors |
+----------------------+--------------------------------------------+ +----------------------+--------------------------------------------+
| GETXATTR | NFS4ERR_ACCESS, NFS4ERR_BADXDR, | | GETXATTR | NFS4ERR_ACCESS, NFS4ERR_BADXDR, |
| | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, | | | NFS4ERR_DEADSESSION, NFS4ERR_DELAY, |
| | NFS4ERR_FHEXPIRED, NFS4ERR_INVAL, | | | NFS4ERR_FHEXPIRED, NFS4ERR_INVAL, |
| | NFS4ERR_IO, NFS4ERR_MOVED, | | | NFS4ERR_IO, NFS4ERR_MOVED, |
| | NFS4ERR_NAMETOOLONG, NFS4ERR_NOFILEHANDLE, | | | NFS4ERR_NAMETOOLONG, NFS4ERR_NOFILEHANDLE, |
| | NFS4ERR_NOTSUPP, NFS4ERR_OP_NOT_IN_SESSION,| | | NFS4ERR_NOTSUPP, NFS4ERR_NOXATTR, |
| | NFS4ERR_PERM, NFS4ERR_REP_TOO_BIG, | | | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PERM, |
| | NFS4ERR_REP_TOO_BIG, |
| | NFS4ERR_REP_TOO_BIG_TO_CACHE, | | | NFS4ERR_REP_TOO_BIG_TO_CACHE, |
| | NFS4ERR_REQ_TOO_BIG, | | | NFS4ERR_REQ_TOO_BIG, |
| | NFS4ERR_RETRY_UNCACHED_REP, | | | NFS4ERR_RETRY_UNCACHED_REP, |
| | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, |
| | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE |
| SETXATTR | NFS4ERR_ACCESS, NFS4ERR_BADCHAR, | | SETXATTR | NFS4ERR_ACCESS, NFS4ERR_BADCHAR, |
| | NFS4ERR_BADXDR, NFS4ERR_DEADSESSION, | | | NFS4ERR_BADXDR, NFS4ERR_DEADSESSION, |
| | NFS4ERR_DELAY, NFS4ERR_DQUOT, | | | NFS4ERR_DELAY, NFS4ERR_DQUOT, |
| | NFS4ERR_EXIST, NFS4ERR_FHEXPIRED, | | | NFS4ERR_EXIST, NFS4ERR_FHEXPIRED, |
| | NFS4ERR_INVAL, NFS4ERR_IO, NFS4ERR_MOVED, | | | NFS4ERR_INVAL, NFS4ERR_IO, NFS4ERR_MOVED, |
| | NFS4ERR_NAMETOOLONG, NFS4ERR_NOFILEHANDLE, | | | NFS4ERR_NAMETOOLONG, NFS4ERR_NOFILEHANDLE, |
| | NFS4ERR_NOSPC, NFS4ERR_OP_NOT_IN_SESSION, | | | NFS4ERR_NOSPC, NFS4ERR_NOXATTR, |
| | NFS4ERR_PERM, NFS4ERR_REP_TOO_BIG, | | | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PERM, |
| | NFS4ERR_REP_TOO_BIG, |
| | NFS4ERR_REP_TOO_BIG_TO_CACHE, | | | NFS4ERR_REP_TOO_BIG_TO_CACHE, |
| | NFS4ERR_REQ_TOO_BIG, | | | NFS4ERR_REQ_TOO_BIG, |
| | NFS4ERR_RETRY_UNCACHED_REP, NFS4ERR_ROFS, | | | NFS4ERR_RETRY_UNCACHED_REP, NFS4ERR_ROFS, |
| | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, |
| | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE, |
| | NFS4ERR_XATTR2BIG |
| LISTXATTRS | NFS4ERR_ACCESS, NFS4ERR_DEADSESSION, | | LISTXATTRS | NFS4ERR_ACCESS, NFS4ERR_DEADSESSION, |
| | NFS4ERR_DELAY, NFS4ERR_INVAL, NFS4ERR_IO, | | | NFS4ERR_DELAY, NFS4ERR_INVAL, NFS4ERR_IO, |
| | NFS4ERR_MOVED, NFS4ERR_NAMETOOLONG, | | | NFS4ERR_MOVED, NFS4ERR_NAMETOOLONG, |
| | NFS4ERR_NOFILEHANDLE, NFS4ERR_NOTSUPP, | | | NFS4ERR_NOFILEHANDLE, NFS4ERR_NOTSUPP, |
| | NFS4ERR_OP_NOT_IN_SESSION, | | | NFS4ERR_NOXATTR, NFS4ERR_OP_NOT_IN_SESSION,|
| | NFS4ERR_PERM, NFS4ERR_REP_TOO_BIG, | | | NFS4ERR_PERM, NFS4ERR_REP_TOO_BIG, |
| | NFS4ERR_REP_TOO_BIG_TO_CACHE, | | | NFS4ERR_REP_TOO_BIG_TO_CACHE, |
| | NFS4ERR_REQ_TOO_BIG, | | | NFS4ERR_REQ_TOO_BIG, |
| | NFS4ERR_RETRY_UNCACHED_REP, | | | NFS4ERR_RETRY_UNCACHED_REP, |
| | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, |
| | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE |
| REMOVEXATTR | NFS4ERR_ACCESS, NFS4ERR_BADCHAR, | | REMOVEXATTR | NFS4ERR_ACCESS, NFS4ERR_BADCHAR, |
| | NFS4ERR_BADXDR, NFS4ERR_DEADSESSION, | | | NFS4ERR_BADXDR, NFS4ERR_DEADSESSION, |
| | NFS4ERR_DELAY, NFS4ERR_DQUOT, | | | NFS4ERR_DELAY, NFS4ERR_DQUOT, |
| | NFS4ERR_EXIST, NFS4ERR_INVAL, NFS4ERR_IO, | | | NFS4ERR_EXIST, NFS4ERR_INVAL, NFS4ERR_IO, |
| | NFS4ERR_LOCKED, NFS4ERR_MOVED, | | | NFS4ERR_LOCKED, NFS4ERR_MOVED, |
| | NFS4ERR_NAMETOOLONG, NFS4ERR_NOFILEHANDLE, | | | NFS4ERR_NAMETOOLONG, NFS4ERR_NOFILEHANDLE, |
| | NFS4ERR_NOSPC, NFS4ERR_OLD_STATEID, | | | NFS4ERR_NOSPC, NFS4ERR_NOXATTR, |
| | NFS4ERR_OPENMODE, | | | NFS4ERR_OLD_STATEID, NFS4ERR_OPENMODE, |
| | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PERM, | | | NFS4ERR_OP_NOT_IN_SESSION, NFS4ERR_PERM, |
| | NFS4ERR_RETRY_UNCACHED_REP, NFS4ERR_ROFS, | | | NFS4ERR_RETRY_UNCACHED_REP, NFS4ERR_ROFS, |
| | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, | | | NFS4ERR_SERVERFAULT, NFS4ERR_STALE, |
| | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE | | | NFS4ERR_TOO_MANY_OPS, NFS4ERR_WRONG_TYPE |
+----------------------+--------------------------------------------+ +----------------------+--------------------------------------------+
8.5. Modifications to Existing Operations 8.5. Modifications to Existing Operations
In order to provide fine-grained access control to query or modify In order to provide fine-grained access control to query or modify
extended attributes, new access rights are defined that can be extended attributes, new access rights are defined that can be
skipping to change at page 22, line 10 skipping to change at page 22, line 13
/// */ /// */
/// typedef bool fattr4_xattr_support; /// typedef bool fattr4_xattr_support;
/// /* /// /*
/// * New RECOMMENDED Attribute /// * New RECOMMENDED Attribute
/// */ /// */
/// const FATTR4_XATTR_SUPPORT = 82; /// const FATTR4_XATTR_SUPPORT = 82;
/// /* /// /*
/// * New NFSv4 operations /// * New NFSv4 operations
/// */ /// */
/// /* Following lines are to be added to enum nfs_opnum4 */ /// /* Following lines are to be added to enum nfs_opnum4 */
/// /* /// /*
/// OP_GETXATTR = 72, /// OP_GETXATTR = 72,
/// OP_SETXATTR = 73, /// OP_SETXATTR = 73,
/// OP_LISTXATTRS = 74, /// OP_LISTXATTRS = 74,
/// OP_REMOVEXATTR = 75, /// OP_REMOVEXATTR = 75,
/// */ /// */
/// /*
/// * New cases for Operation arrays
/// */
/// /* Following lines are to be added to nfs_argop4 */
/// /*
/// case OP_GETXATTR: GETXATTR4args opgetxattr;
/// case OP_SETXATTR: SETXATTR4args opsetxattr;
/// case OP_LISTXATTRS: LISTXATTRS4args oplistxattrs;
/// case OP_REMOVEXATTR: REMOVEXATTR4args opremovexattr;
/// */
/// /* Following lines are to be added to nfs_resop4 */
/// /*
/// case OP_GETXATTR: GETXATTR4res opgetxattr;
/// case OP_SETXATTR: SETXATTR4res opsetxattr;
/// case OP_LISTXATTRS: LISTXATTRS4res oplistxattrs;
/// case OP_REMOVEXATTR: REMOVEXATTR4res opremovexattr;
/// */
<CODE ENDS> <CODE ENDS>
8.7. Caching 8.7. Caching
The caching behavior for extended attributes is similar to other The caching behavior for extended attributes is similar to other
file attributes such as ACLs and is affected by whether OPEN file attributes such as ACLs and is affected by whether OPEN
delegation has been granted to a client or not. delegation has been granted to a client or not.
Xattrs obtained from, or sent to, the server may be cached and Xattrs obtained from, or sent to, the server may be cached and
clients can use them to avoid subsequent GETXATTR requests, clients can use them to avoid subsequent GETXATTR requests,
 End of changes. 14 change blocks. 
19 lines changed or deleted 41 lines changed or added

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