Network File System Version 4 T. Haynes Internet-Draft Hammerspace Intended status: Standards Track 13 October 2024 Expires: 16 April 2025 Adding an Uncacheable Attribute to NFSv4.2 draft-haynes-nfsv4-uncacheable-01 Abstract The Network File System v4.2 (NFSv4.2) allows a client to cache both the metadata and the data for a file object. It can also cache the metadata for a directory object. Caching the dirents (i.e., the metadata) allows the client to avoid querying the server to refresh information. But this defeats the server checking to see if the user has permission to view the dirent's attributes. Caching the data can cause performance impacts if the page cache hit rate is low.. This document introduces a new file attribute called uncacheable which indicates that the client MUST NOT cache the metadata or data for that dirent. This document extends NFSv4.2 (see RFC7863). Note This note is to be removed before publishing as an RFC. Discussion of this draft takes place on the NFSv4 working group mailing list (nfsv4@ietf.org), which is archived at https://mailarchive.ietf.org/arch/browse/nfsv4/. Working Group information can be found at https://datatracker.ietf.org/wg/nfsv4/ about/. Status of This Memo This Internet-Draft is submitted in full conformance with the provisions of BCP 78 and BCP 79. Internet-Drafts are working documents of the Internet Engineering Task Force (IETF). Note that other groups may also distribute working documents as Internet-Drafts. The list of current Internet- Drafts is at https://datatracker.ietf.org/drafts/current/. Internet-Drafts are draft documents valid for a maximum of six months and may be updated, replaced, or obsoleted by other documents at any time. It is inappropriate to use Internet-Drafts as reference material or to cite them other than as "work in progress." This Internet-Draft will expire on 16 April 2025. Haynes Expires 16 April 2025 [Page 1] Internet-Draft Uncacheable October 2024 Copyright Notice Copyright (c) 2024 IETF Trust and the persons identified as the document authors. All rights reserved. This document is subject to BCP 78 and the IETF Trust's Legal Provisions Relating to IETF Documents (https://trustee.ietf.org/ license-info) in effect on the date of publication of this document. Please review these documents carefully, as they describe your rights and restrictions with respect to this document. Code Components extracted from this document must include Revised BSD License text as described in Section 4.e of the Trust Legal Provisions and are provided without warranty as described in the Revised BSD License. Table of Contents 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . 2 1.1. Definitions . . . . . . . . . . . . . . . . . . . . . . . 3 1.2. Requirements Language . . . . . . . . . . . . . . . . . . 3 2. Uncacheable Dirents . . . . . . . . . . . . . . . . . . . . . 3 3. Uncacheable Files . . . . . . . . . . . . . . . . . . . . . . 3 4. XDR for Offline Attribute . . . . . . . . . . . . . . . . . . 3 5. Extraction of XDR . . . . . . . . . . . . . . . . . . . . . . 4 6. Security Considerations . . . . . . . . . . . . . . . . . . . 4 7. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 5 8. References . . . . . . . . . . . . . . . . . . . . . . . . . 5 8.1. Normative References . . . . . . . . . . . . . . . . . . 5 Appendix A. Acknowledgments . . . . . . . . . . . . . . . . . . 5 Author's Address . . . . . . . . . . . . . . . . . . . . . . . . 5 1. Introduction In the Network File System version 4.2 (NFSv4.2) (see [RFC7863]) , a client queries for either a file's or directory's attributes via either GETATTR (see Section 18.7 of [RFC8881]) or READDIR (see Section 18.23 of [RFC8881]) to the server. These directory entries (dirents) can be cached locally by the client. As these cached dirents are shared by all users on the clients and the client can not determine access to these dirents, all users are presented with the same set of attributes. We introduce the new uncacheable attribute, which informs the client not to cache a dirent for that file or directory object. As such each time the client queries for those attributes, the response can be tailored to that user. That decision can be based on either Access Control List (ACL) on a file or directory object (see Section 6 of [RFC8881]) or proprietary policies. Haynes Expires 16 April 2025 [Page 2] Internet-Draft Uncacheable October 2024 Besides the caching of metadata for both files and directories, the client can also cache data for files. The uncacheable attribute also informs the client to avoid its page cache. It is very similar to passing the O_DIRECT to the open call. This can be useful for files that are not shared and also for ones which do not meet the expectations of the caching patterns of the page cache. Using the process detailed in [RFC8178], the revisions in this document become an extension of NFSv4.2 [RFC7862]. They are built on top of the external data representation (XDR) [RFC4506] generated from [RFC7863]. 1.1. Definitions Access Based Enumeration: When servicing either a READDIR or a GETATTR, base the result on the access permitted to the user making the request. dirent: A directory entry, describing either a directory or a file. 1.2. Requirements Language The key words 'MUST', 'MUST NOT', 'REQUIRED', 'SHALL', 'SHALL NOT', 'SHOULD', 'SHOULD NOT', 'RECOMMENDED', 'NOT RECOMMENDED', 'MAY', and 'OPTIONAL' in this document are to be interpreted as described in BCP 14 [RFC2119] [RFC8174] when, and only when, they appear in all capitals, as shown here. 2. Uncacheable Dirents If a file object or directory has the uncacheable attribute set, then the client MUST NOT cache their dirent attributes. I.e., just because it presented the attributes to user A on the first request, then on a subsequent request, it MUST query for those attributes again. Also, the client MUST NOT share attributes between different users. 3. Uncacheable Files If a file object is marked as uncacheable, that also means all modifications to the file MUST immediately be sent from the client to the server. I.e., the data is also not cacheable. 4. XDR for Offline Attribute Haynes Expires 16 April 2025 [Page 3] Internet-Draft Uncacheable October 2024 /// /// typedef bool fattr4_uncacheable; /// /// const FATTR4_UNCACHEABLE = 87; /// 5. Extraction of XDR This document contains the external data representation (XDR) [RFC4506] description of the uncacheable attribute. The XDR description is embedded in this document in a way that makes it simple for the reader to extract into a ready-to-compile form. The reader can feed this document into the following shell script to produce the machine readable XDR description of the new flags: #!/bin/sh grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??' That is, if the above script is stored in a file called 'extract.sh', and this document is in a file called 'spec.txt', then the reader can do: sh extract.sh < spec.txt > uncacheable_prot.x The effect of the script is to remove leading white space from each line, plus a sentinel sequence of '///'. XDR descriptions with the sentinel sequence are embedded throughout the document. Note that the XDR code contained in this document depends on types from the NFSv4.2 nfs4_prot.x file (generated from [RFC7863]). This includes both nfs types that end with a 4, such as offset4, length4, etc., as well as more generic types such as uint32_t and uint64_t. While the XDR can be appended to that from [RFC7863], the various code snippets belong in their respective areas of that XDR. 6. Security Considerations Clients MUST NOT make access decisions to uncacheable dirents, these decisions MUST be made by the server. With the uncacheable attribute, dirents can be annotated such that attributes can be presented to the user based on the server's decision. Haynes Expires 16 April 2025 [Page 4] Internet-Draft Uncacheable October 2024 7. IANA Considerations There are no IANA considerations. 8. References 8.1. Normative References [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate Requirement Levels", BCP 14, RFC 2119, DOI 10.17487/RFC2119, March 1997, . [RFC4506] Eisler, M., Ed., "XDR: External Data Representation Standard", STD 67, RFC 4506, DOI 10.17487/RFC4506, May 2006, . [RFC7862] Haynes, T., "Network File System (NFS) Version 4 Minor Version 2 Protocol", RFC 7862, DOI 10.17487/RFC7862, November 2016, . [RFC7863] Haynes, T., "Network File System (NFS) Version 4 Minor Version 2 External Data Representation Standard (XDR) Description", RFC 7863, DOI 10.17487/RFC7863, November 2016, . [RFC8174] Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC 2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174, May 2017, . [RFC8178] Noveck, D., "Rules for NFSv4 Extensions and Minor Versions", RFC 8178, DOI 10.17487/RFC8178, July 2017, . [RFC8881] Noveck, D., Ed. and C. Lever, "Network File System (NFS) Version 4 Minor Version 1 Protocol", RFC 8881, DOI 10.17487/RFC8881, August 2020, . Appendix A. Acknowledgments Trond Myklebust and Thomas Haynes all worked on the prototype at Hammerspace. Author's Address Thomas Haynes Hammerspace Haynes Expires 16 April 2025 [Page 5] Internet-Draft Uncacheable October 2024 Email: loghyr@gmail.com Haynes Expires 16 April 2025 [Page 6]