Network File System Version 4                                  T. Haynes
Internet-Draft                                               Hammerspace
Intended status: Standards Track                           18 March 2025
Expires: 19 September 2025


               Adding an Uncacheable Attribute to NFSv4.2
                   draft-haynes-nfsv4-uncacheable-02

Abstract

   The Network File System version 4.2 (NFSv4.2) allows a client to
   cache both metadata and data for file objects, as well as metadata
   for directory objects.  While caching directory entries (dirents) can
   improve performance, it can also prevent the server from enforcing
   access control on individual dirents.  Similarly, caching file data
   can lead to performance issues if the cache hit rate is low.  This
   document introduces a new uncacheable attribute for NFSv4.  Files and
   dirents marked as uncacheable MUST NOT be stored in client-side
   caches.  This ensures data consistency and integrity by requiring
   clients to always retrieve the most recent data directly from the
   server.  This document extends NFSv4.2 (see RFC7862).

Note to Readers

   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/search/?email_list=nfsv4.  Source
   code and issues list for this draft can be found at
   https://github.com/ietf-wg-nfsv4/uncacheable.

   Working Group information can be found at https://github.com/ietf-wg-
   nfsv4.

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."



Haynes                  Expires 19 September 2025               [Page 1]

Internet-Draft            Uncacheable Attribute               March 2025


   This Internet-Draft will expire on 19 September 2025.

Copyright Notice

   Copyright (c) 2025 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 . . . . . . . . . . . . . . . . . . . . .   4
   3.  Uncacheable Files . . . . . . . . . . . . . . . . . . . . . .   4
   4.  XDR for Offline Attribute . . . . . . . . . . . . . . . . . .   4
   5.  Extraction of XDR . . . . . . . . . . . . . . . . . . . . . .   4
   6.  Security Considerations . . . . . . . . . . . . . . . . . . .   5
   7.  IANA Considerations . . . . . . . . . . . . . . . . . . . . .   5
   8.  Normative References  . . . . . . . . . . . . . . . . . . . .   5
   Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . . .   6
   Author's Address  . . . . . . . . . . . . . . . . . . . . . . . .   6

1.  Introduction

   In the Network File System version 4.2 (NFSv4.2) [RFC7863], a client
   queries for either a file's or directory's attributes via either
   GETATTR Section 18.7 of [RFC8881] or READDIR Section 18.23 of
   [RFC8881] to the server.  These directory entries (dirents) can be
   cached locally by the client.













Haynes                  Expires 19 September 2025               [Page 2]

Internet-Draft            Uncacheable Attribute               March 2025


   Since cached dirents are shared by all users on a client, and the
   client cannot determine access permissions for individual dirents,
   all users are presented with the same set of attributes.  To address
   this, this document introduces the new uncacheable attribute.  This
   attribute instructs the client not to cache the dirent for a file or
   directory object.  Consequently, each time a client queries for these
   attributes, the server's response can be tailored to the specific
   user making the request, based on factors such as Access Control
   Lists (ACLs) on the file or directory object Section 6 of [RFC8881]
   or proprietary policies.

   In addition to caching metadata, clients can also cache file data.
   The uncacheable attribute also instructs the client to bypass its
   page cache for the file.  This behavior is similar to using the
   O_DIRECT flag with the open call.  This can be beneficial for files
   that are not shared or for files that do not exhibit access patterns
   suitable for caching.

   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 a READDIR or GETATTR
      operation, the server provides results based on the access
      permissions of the user making the request.

   dirent  A directory entry, representing either a file or a
      subdirectory.  In the context of NFSv4, a dirent marked as
      uncacheable MUST NOT be cached by clients.

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.











Haynes                  Expires 19 September 2025               [Page 3]

Internet-Draft            Uncacheable Attribute               March 2025


2.  Uncacheable Dirents

   If a file object or directory has the uncacheable attribute set, then
   the client MUST NOT cache its dirent attributes.  This means that
   even if the client has previously retrieved the attributes for a
   user, it MUST query the server again for those attributes on
   subsequent requests.  Additionally, the client MUST NOT share
   attributes between different users.

3.  Uncacheable Files

   If a file object is marked as uncacheable, all modifications to the
   file MUST be immediately sent from the client to the server.  In
   other words, the file data is also not cacheable.

4.  XDR for Offline Attribute

   ///
   /// 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 presented in a manner that facilitates easy extraction
   into a ready-to-compile format.  To extract the machine-readable XDR
   description, use the following shell script:

   #!/bin/sh
   grep '^ *///' $* | sed 's?^ */// ??' | sed 's?^ *///$??'

   For example, if the script is named 'extract.sh' and this document is
   named 'spec.txt', execute the following command:

   sh extract.sh < spec.txt > uncacheable_prot.x

   This script removes leading blank spaces and the sentinel sequence
   '///' from each line.  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.




Haynes                  Expires 19 September 2025               [Page 4]

Internet-Draft            Uncacheable Attribute               March 2025


   While the XDR can be appended to that from [RFC7863], the code
   snippets should be placed in their appropriate sections within the
   existing XDR.

6.  Security Considerations

   Clients MUST NOT make access decisions for uncacheable dirents.
   These decisions MUST be made by the server.  The uncacheable
   attribute allows dirents to be annotated such that attributes are
   presented to the user based on the server's access control decisions.

7.  IANA Considerations

   This document has no IANA actions.

8.  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,
              <https://www.rfc-editor.org/rfc/rfc2119>.

   [RFC4506]  Eisler, M., Ed., "XDR: External Data Representation
              Standard", STD 67, RFC 4506, DOI 10.17487/RFC4506, May
              2006, <https://www.rfc-editor.org/rfc/rfc4506>.

   [RFC7862]  Haynes, T., "Network File System (NFS) Version 4 Minor
              Version 2 Protocol", RFC 7862, DOI 10.17487/RFC7862,
              November 2016, <https://www.rfc-editor.org/rfc/rfc7862>.

   [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, <https://www.rfc-editor.org/rfc/rfc7863>.

   [RFC8174]  Leiba, B., "Ambiguity of Uppercase vs Lowercase in RFC
              2119 Key Words", BCP 14, RFC 8174, DOI 10.17487/RFC8174,
              May 2017, <https://www.rfc-editor.org/rfc/rfc8174>.

   [RFC8178]  Noveck, D., "Rules for NFSv4 Extensions and Minor
              Versions", RFC 8178, DOI 10.17487/RFC8178, July 2017,
              <https://www.rfc-editor.org/rfc/rfc8178>.

   [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,
              <https://www.rfc-editor.org/rfc/rfc8881>.




Haynes                  Expires 19 September 2025               [Page 5]

Internet-Draft            Uncacheable Attribute               March 2025


Acknowledgments

   Trond Myklebust and Thomas Haynes all worked on the prototype at
   Hammerspace.

Author's Address

   Thomas Haynes
   Hammerspace
   Email: loghyr@gmail.com









































Haynes                  Expires 19 September 2025               [Page 6]