[PATCH 0/6] nfsd: add new export options for controlling read/write iomode

From: Jeff Layton

Date: Tue Oct 27 2026 - 12:50:55 EST


When we originally added support for the dontcache and direct iomodes to
nfsd, we added global debugfs switches to control them. That was fine for
experimentation but the goal was always to move these controls to
something more permanent.

This patch series adds a new set of riomode= and wiomode= export
options. With this, we can set the read and write iomode on a per-export
basis to either buffered, direct or dontcache.

The debugfs knobs stick around and govern the default iomode when it's
not set on the export. Eventually these controls should also be moved to
something more permanent (or maybe just be removed), but I've left that
as a future change.

The last patch adds new documentation that attempts to give the admin
some guidance on choosing r/wiomode settings.

A companion nfs-utils patchset will follow that adds support for these
options to exportfs/mountd, and adds a new script to help users choose
iomode settings.

Signed-off-by: Jeff Layton <jlayton@xxxxxxxxxx>
---
Jeff Layton (6):
NFSD: Add per-export read/write I/O mode settings
NFSD: Apply per-export I/O modes to READ and WRITE
NFSD: Document per-export riomode= and wiomode= options
NFSD: Keep per-export statistics across export cache updates
NFSD: Count the storage reads of each export's READs
NFSD: Document how to choose an IO mode

Documentation/filesystems/nfs/nfsd-io-modes.rst | 194 +++++++++++++++++
Documentation/netlink/specs/nfsd.yaml | 24 +++
fs/nfsd/debugfs.c | 6 +-
fs/nfsd/export.c | 268 +++++++++++++++++++++---
fs/nfsd/export.h | 19 ++
fs/nfsd/netlink.c | 4 +-
fs/nfsd/netlink.h | 2 +-
fs/nfsd/netns.h | 6 +
fs/nfsd/nfs4xdr.c | 6 +-
fs/nfsd/nfsd.h | 17 +-
fs/nfsd/stats.h | 33 +++
fs/nfsd/vfs.c | 59 +++++-
fs/nfsd/vfs.h | 2 +
include/uapi/linux/nfsd_netlink.h | 12 ++
14 files changed, 599 insertions(+), 53 deletions(-)
---
base-commit: fa65fd6d503d4e965ae27b1a75969e097569390a
change-id: 20261013-export-iomode-1b56e9d89821

Best regards,
--
Jeff Layton <jlayton@xxxxxxxxxx>