| Internet-Draft | Uncacheable File Attribute | November 2025 |
| Haynes | Expires 22 May 2026 | [Page] |
The Network File System version 4.2 (NFSv4.2) allows a client to cache data for file objects. Caching file data can lead to performance issues if the cache hit rate is low. This document introduces a new uncacheable file attribute for NFSv4.2. Files marked as uncacheable MUST NOT be stored in client-side caches. This document extends NFSv4.2 (see RFC7862).¶
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-files.¶
Working Group information can be found at https://github.com/ietf-wg-nfsv4.¶
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 22 May 2026.¶
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.¶
With a remote filesystem, the client typically caches file contents in order to improve performance. Several assumptions are made about the rate of change in the number of clients trying to concurrently access a file. With NFSv4.2, this could practically be mitigated practically by file delegations for the file contents.¶
There are prior efforts to bypass file caching. In Highly Parallel Computing (HPC) workloads, file caching is bypassed in order to achieve consistent work flows.¶
This document introduces the uncacheable file attribute to NFSv4.2 to bypass file caching on the client. As such, it is an OPTIONAL to implement attribute for NFSv4.2. However, if both the client and the server support this attribute, then the client MUST follow the semantics of uncacheable.What about mixed modes?¶
A client can easily determine whether or not a server supports the uncacheable file attribute with a simple GETATTR on any file. Is this still true? If the server does not support the uncacheable attribute, it will return an error of NFS4ERR_ATTRNOTSUPP.¶
The only way that the server can determine that the client supports the attribute is if the client sends either a GETATTR or a SETATTR with the uncacheable attribute.¶
As bypassing file caching is file based, it is only applicable for dirents which are of type attribute value of NF4REG.¶
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].¶
A client cache, normally called the page cache, which caches the contents of a regular file. Typical usage would be to accumulate changes to be bunched together for writing to the server.¶
Further, the definitions of the following terms are referenced as follows:¶
file delegations (Section 10.2 of [RFC8881])¶
GETATTR (Section 18.7 of [RFC8881])¶
NF4REG (Section 5.8.1.2 of [RFC8881])¶
NFS4ERR_ATTRNOTSUPP (Section 15.1.15.1 of [RFC8881]¶
SETATTR (Section 18.30 of [RFC8881])¶
system (Section 5.8.2.36 of [RFC8881])¶
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.¶
The uncacheable file attribute 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 ([open]). This can be beneficial for files that are not shared or for files that do not exhibit access patterns suitable for caching.¶
However, the real need for bypassing write caching is evident in HPC workloads. In general, these involve massive data transfers and require extremely low latency. Write caching can introduce unpredictable latency, as data is buffered and flushed later.¶
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.¶
/// /// typedef bool fattr4_uncacheable_file; /// /// const FATTR4_UNCACHEABLE_FILE = 87; ///¶
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.¶
While the XDR can be appended to that from [RFC7863], the code snippets should be placed in their appropriate sections within the existing XDR.¶
This document imposes no new security considerations to NFSv4.2.¶
This document has no IANA actions.¶
Trond Myklebust, Mike Snitzer, and Thomas Haynes all worked on the prototype at Hammerspace.¶
Chris Inacio, Brian Pawlowski, and Gorry Fairhurst helped guide this process.¶