[PATCH 00/29] fs: require filesystems to explicitly opt-in to nfsd export support

Jeff Layton
2026-01-15T17:48:02Z

In recent years, a number of filesystems that can't present stable
filehandles have grown struct export_operations. They've mostly done
this for local use-cases (enabling open_by_handle_at() and the like).
Unfortunately, having export_operations is generally sufficient to make
a filesystem be considered exportable via nfsd, but that requires that
the server present stable filehandles.

This patchset declares a new EXPORT_OP_STABLE_HANDLES flag, adds it to
all of the filesystems that have stable filehandles, and then adds a
check in nfsd to ensure that that flag is set for any filesystem to
which it has been presented a handle. When a filesystem doesn't have
this flag, it will treat the filehandle as stale.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Jeff Layton (29):
exportfs: add new EXPORT_OP_STABLE_HANDLES flag
tmpfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
ext4: add EXPORT_OP_STABLE_HANDLES flag to export operations
ext2: add EXPORT_OP_STABLE_HANDLES flag to export operations
erofs: add EXPORT_OP_STABLE_HANDLES flag to export operations
efs: add EXPORT_OP_STABLE_HANDLES flag to export operations
xfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
ceph: add EXPORT_OP_STABLE_HANDLES flag to export operations
btrfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
befs: add EXPORT_OP_STABLE_HANDLES flag to export operations
ufs: add EXPORT_OP_STABLE_HANDLES flag to export operations
udf: add EXPORT_OP_STABLE_HANDLES flag to export operations
affs: add EXPORT_OP_STABLE_HANDLES flag to export operations
squashfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
smb/client: add EXPORT_OP_STABLE_HANDLES flag to export operations
ovl: add EXPORT_OP_STABLE_HANDLES flag to export operations
orangefs: add EXPORT_OP_STABLE_HANDLES flag to export operations
ocfs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
ntfs3: add EXPORT_OP_STABLE_HANDLES flag to export operations
nilfs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
nfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
jfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
jffs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
isofs: add EXPORT_OP_STABLE_HANDLES flag to export operations
gfs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
fuse: add EXPORT_OP_STABLE_HANDLES flag to export operations
fat: add EXPORT_OP_STABLE_HANDLES flag to export operations
f2fs: add EXPORT_OP_STABLE_HANDLES flag to export operations
nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES

fs/affs/namei.c | 1 +
fs/befs/linuxvfs.c | 1 +
fs/btrfs/export.c | 1 +
fs/ceph/export.c | 1 +
fs/efs/super.c | 1 +
fs/erofs/super.c | 1 +
fs/ext2/super.c | 1 +
fs/ext4/super.c | 1 +
fs/f2fs/super.c | 1 +
fs/fat/nfs.c | 2 ++
fs/fuse/inode.c | 2 ++
fs/gfs2/export.c | 1 +
fs/isofs/export.c | 1 +
fs/jffs2/super.c | 1 +
fs/jfs/super.c | 1 +
fs/nfs/export.c | 3 ++-
fs/nfsd/nfsfh.c | 4 ++++
fs/nilfs2/namei.c | 1 +
fs/ntfs3/super.c | 1 +
fs/ocfs2/export.c | 1 +
fs/orangefs/super.c | 1 +
fs/overlayfs/export.c | 2 ++
fs/smb/client/export.c | 1 +
fs/squashfs/export.c | 3 ++-
fs/udf/namei.c | 1 +
fs/ufs/super.c | 1 +
fs/xfs/xfs_export.c | 1 +
include/linux/exportfs.h | 16 +++++++++-------
mm/shmem.c | 1 +
29 files changed, 45 insertions(+), 9 deletions(-)
---
base-commit: c537e12daeecaecdcd322c56a5f70659d2de7bde
change-id: 20260114-exportfs-nfsd-12515072e9a9

Best regards,
--
Jeff Layton <jlayton@kernel.org>