Linux NFS development
 help / color / mirror / Atom feed
From: Mike Snitzer <snitzer@kernel.org>
To: Trond Myklebust <trondmy@kernel.org>, Anna Schumaker <anna@kernel.org>
Cc: Tom Haynes <loghyr@hammerspace.com>, Chuck Lever <cel@kernel.org>,
	linux-nfs@vger.kernel.org
Subject: [PATCH 0/4] nfs: NFSv4.2 client support for UNCACHEABLE_FILE_DATA
Date: Wed, 24 Jun 2026 15:17:02 -0400	[thread overview]
Message-ID: <20260624191706.72544-1-snitzer@kernel.org> (raw)

Hi,

This series adds Linux NFSv4.2 client support for the uncacheable file
data attribute defined by draft-ietf-nfsv4-uncacheable-files [1].

The attribute is an OPTIONAL, per-file, read-write boolean (FATTR4
number 87) that a server may set on a regular file to advise the client
to suppress client-side caching of that file's data -- both write-behind
and read caching.  It is conceptually similar to O_DIRECT but operates at
the protocol level and requires no application changes.  The motivating
use case is HPC-style concurrent writers modifying disjoint byte ranges
of a shared file, where cached/delayed writes cause read-modify-write
hazards ("write holes").

This client honors a server-set attribute; it does not set it (that is
left to server/administrator policy).  When a regular file is marked
uncacheable, the client opens it O_DIRECT, which suppresses read and
write-behind caching and satisfies the spec's durability invariant via
the existing direct-I/O path.  The attribute applies only to regular
files (NF4REG), so the client requests it only for regular files.

The series is organized as:

  1/4  add Documentation/sunrpc/xdr/nfs4_2.x and generate the
       FATTR4_UNCACHEABLE_FILE_DATA definition via xdrgen, mirroring how
       the sibling NFSv4.2 attributes are defined and consumed.
  2/4  decode the attribute via GETATTR, track per-exported-filesystem
       support, and record it on the inode.
  3/4  request the attribute only for regular files, since a server must
       reject a query of it on any other object type with NFS4ERR_INVAL.
  4/4  open uncacheable regular files O_DIRECT.

[1] https://datatracker.ietf.org/doc/draft-ietf-nfsv4-uncacheable-files/

All review appreciated, thanks.
Mike

Mike Snitzer (3):
  nfs4.2: add nfs4_2.x to generate the UNCACHEABLE_FILE_DATA attribute
  nfs4.2: request UNCACHEABLE_FILE_DATA only for regular files
  nfs4.2: open UNCACHEABLE_FILE_DATA files with O_DIRECT

Tom Haynes (1):
  nfs4.2: add UNCACHEABLE_FILE_DATA attribute support

 Documentation/sunrpc/xdr/nfs4_2.x    | 52 ++++++++++++++++++++++++
 fs/nfs/dir.c                         |  4 ++
 fs/nfs/inode.c                       | 24 +++++++++--
 fs/nfs/nfs4file.c                    |  2 +
 fs/nfs/nfs4proc.c                    | 60 +++++++++++++++++++++++++---
 fs/nfs/nfs4trace.h                   |  4 +-
 fs/nfs/nfs4xdr.c                     | 35 +++++++++++++++-
 fs/nfs/nfstrace.h                    |  3 +-
 fs/nfsd/Makefile                     |  5 ++-
 include/linux/nfs4.h                 |  2 +
 include/linux/nfs_fs.h               |  4 ++
 include/linux/nfs_xdr.h              |  8 +++-
 include/linux/sunrpc/xdrgen/nfs4_2.h | 19 +++++++++
 13 files changed, 209 insertions(+), 13 deletions(-)
 create mode 100644 Documentation/sunrpc/xdr/nfs4_2.x
 create mode 100644 include/linux/sunrpc/xdrgen/nfs4_2.h

-- 
2.47.3


             reply	other threads:[~2026-06-24 19:17 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-06-24 19:17 Mike Snitzer [this message]
2026-06-24 19:17 ` [PATCH 1/4] nfs4.2: add nfs4_2.x to generate the UNCACHEABLE_FILE_DATA attribute Mike Snitzer
2026-06-24 19:17 ` [PATCH 2/4] nfs4.2: add UNCACHEABLE_FILE_DATA attribute support Mike Snitzer
2026-06-24 19:17 ` [PATCH 3/4] nfs4.2: request UNCACHEABLE_FILE_DATA only for regular files Mike Snitzer
2026-06-24 19:17 ` [PATCH 4/4] nfs4.2: open UNCACHEABLE_FILE_DATA files with O_DIRECT Mike Snitzer

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20260624191706.72544-1-snitzer@kernel.org \
    --to=snitzer@kernel.org \
    --cc=anna@kernel.org \
    --cc=cel@kernel.org \
    --cc=linux-nfs@vger.kernel.org \
    --cc=loghyr@hammerspace.com \
    --cc=trondmy@kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox