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