linux-mm.kvack.org archive mirror
 help / color / mirror / Atom feed
* [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support
@ 2026-01-19 16:26 Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS Jeff Layton
                   ` (30 more replies)
  0 siblings, 31 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton, Viacheslav Dubeyko, Dave Kleikamp

This patchset adds a flag that indicates whether the filesystem supports
stable filehandles (i.e. that they don't change over the life of the
file). It then makes any filesystem that doesn't set that flag
ineligible for nfsd export.

The main only place I found where this was an issue today is cgroupfs,
which sane people don't export anyway. So, I don't see this as
addressing a major problem that we have today. Rather, this patchset
ensures that new filesystems that are added in the future make export
eligibility via nfsd a deliberate step, rather than something they've
inadvertently enabled just by adding filehandle support.

After some lively bikeshedding on v1, I think the consensus is to stick
with EXPORT_OP_STABLE_HANDLES as the flag name. Amir is correct that
checking this in check_export() is the better place to do this, since
the filehandle can't be decoded without resolving the export first.

There are a few other fixes and cleanups, and some doc updates too.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
Changes in v2:
- don't set flag in ovl_export_fid_operations or fuse_export_fid_operations
- check for flag in check_export() instead of __fh_verify()
- document missing flags in exporting.rst
- convert dprintk() messages in check_export() to static tracepoints
- Link to v1: https://lore.kernel.org/r/20260115-exportfs-nfsd-v1-0-8e80160e3c0c@kernel.org

---
Jeff Layton (31):
      Documentation: document EXPORT_OP_NOLOCKS
      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
      nfsd: convert dprintks in check_export() to tracepoints

 Documentation/filesystems/nfs/exporting.rst | 13 ++++++++
 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                             |  1 +
 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/export.c                            | 24 ++++++++-----
 fs/nfsd/trace.h                             | 52 +++++++++++++++++++++++++++++
 fs/nilfs2/namei.c                           |  1 +
 fs/ntfs3/super.c                            |  1 +
 fs/ocfs2/export.c                           |  1 +
 fs/orangefs/super.c                         |  1 +
 fs/overlayfs/export.c                       |  1 +
 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 +
 31 files changed, 120 insertions(+), 17 deletions(-)
---
base-commit: c537e12daeecaecdcd322c56a5f70659d2de7bde
change-id: 20260114-exportfs-nfsd-12515072e9a9

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



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-20  7:44   ` Christoph Hellwig
  2026-01-19 16:26 ` [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag Jeff Layton
                   ` (29 subsequent siblings)
  30 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

This got missed when the flag was added. Document it properly.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 Documentation/filesystems/nfs/exporting.rst | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/Documentation/filesystems/nfs/exporting.rst b/Documentation/filesystems/nfs/exporting.rst
index de64d2d002a204c5460980c898d4ec41fd43d47a..0583a0516b1e3a3e6a10af95ff88506cf02f7df4 100644
--- a/Documentation/filesystems/nfs/exporting.rst
+++ b/Documentation/filesystems/nfs/exporting.rst
@@ -238,3 +238,9 @@ following flags are defined:
     all of an inode's dirty data on last close. Exports that behave this
     way should set EXPORT_OP_FLUSH_ON_CLOSE so that NFSD knows to skip
     waiting for writeback when closing such files.
+
+  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
+    filesystems cannot properly support file locking as implemented by
+    nfsd. A case in point is reexport of NFS itself, which can't be done
+    safely without coordinating the grace period handling. Other clustered
+    and networked filesystems can be problematic here as well.

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:41   ` Amir Goldstein
  2026-01-20  7:50   ` Christoph Hellwig
  2026-01-19 16:26 ` [PATCH v2 03/31] tmpfs: add EXPORT_OP_STABLE_HANDLES flag to export operations Jeff Layton
                   ` (28 subsequent siblings)
  30 siblings, 2 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

At one time, nfsd could take the presence of struct export_operations to
be an indicator that a filesystem was exportable via NFS. Since then, a
lot of filesystems have grown export operations in order to provide
filehandle support. Some of those (e.g. kernfs, pidfs, and nsfs) are not
suitable for export via NFS since they lack filehandles that are
stable across reboot.

Add a new EXPORT_OP_STABLE_HANDLES flag that indicates that the
filesystem supports perisistent filehandles, a requirement for nfs
export. While in there, switch to the BIT() macro for defining these
flags.

For now, the flag is not checked anywhere. That will come later after
we've added it to the existing filesystems that need to remain
exportable.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 Documentation/filesystems/nfs/exporting.rst |  7 +++++++
 include/linux/exportfs.h                    | 16 +++++++++-------
 2 files changed, 16 insertions(+), 7 deletions(-)

diff --git a/Documentation/filesystems/nfs/exporting.rst b/Documentation/filesystems/nfs/exporting.rst
index 0583a0516b1e3a3e6a10af95ff88506cf02f7df4..0c29ee44e3484cef84d2d3d47819acf172d275a3 100644
--- a/Documentation/filesystems/nfs/exporting.rst
+++ b/Documentation/filesystems/nfs/exporting.rst
@@ -244,3 +244,10 @@ following flags are defined:
     nfsd. A case in point is reexport of NFS itself, which can't be done
     safely without coordinating the grace period handling. Other clustered
     and networked filesystems can be problematic here as well.
+
+  EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
+    stable across the lifetime of a file. This is a hard requirement for export
+    via nfsd. Any filesystem that is eligible to be exported via nfsd must
+    indicate this guarantee by setting this flag. Most disk-based filesystems
+    can do this naturally. Pseudofilesystems that are for local reporting and
+    control (e.g. kernfs, pidfs, nsfs) usually can't support this.
diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index f0cf2714ec52dd942b8f1c455a25702bd7e412b3..c4e0f083290e7e341342cf0b45b58fddda3af65e 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -3,6 +3,7 @@
 #define LINUX_EXPORTFS_H 1
 
 #include <linux/types.h>
+#include <linux/bits.h>
 #include <linux/path.h>
 
 struct dentry;
@@ -277,15 +278,16 @@ struct export_operations {
 			     int nr_iomaps, struct iattr *iattr);
 	int (*permission)(struct handle_to_path_ctx *ctx, unsigned int oflags);
 	struct file * (*open)(const struct path *path, unsigned int oflags);
-#define	EXPORT_OP_NOWCC			(0x1) /* don't collect v3 wcc data */
-#define	EXPORT_OP_NOSUBTREECHK		(0x2) /* no subtree checking */
-#define	EXPORT_OP_CLOSE_BEFORE_UNLINK	(0x4) /* close files before unlink */
-#define EXPORT_OP_REMOTE_FS		(0x8) /* Filesystem is remote */
-#define EXPORT_OP_NOATOMIC_ATTR		(0x10) /* Filesystem cannot supply
+#define EXPORT_OP_NOWCC			BIT(0) /* don't collect v3 wcc data */
+#define EXPORT_OP_NOSUBTREECHK		BIT(1) /* no subtree checking */
+#define EXPORT_OP_CLOSE_BEFORE_UNLINK	BIT(2) /* close files before unlink */
+#define EXPORT_OP_REMOTE_FS		BIT(3) /* Filesystem is remote */
+#define EXPORT_OP_NOATOMIC_ATTR		BIT(4) /* Filesystem cannot supply
 						  atomic attribute updates
 						*/
-#define EXPORT_OP_FLUSH_ON_CLOSE	(0x20) /* fs flushes file data on close */
-#define EXPORT_OP_NOLOCKS		(0x40) /* no file locking support */
+#define EXPORT_OP_FLUSH_ON_CLOSE	BIT(5) /* fs flushes file data on close */
+#define EXPORT_OP_NOLOCKS		BIT(6) /* no file locking support */
+#define EXPORT_OP_STABLE_HANDLES	BIT(7) /* fhs are stable across reboot */
 	unsigned long	flags;
 };
 

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 03/31] tmpfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 04/31] ext4: " Jeff Layton
                   ` (27 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to tmpfs export operations to
indicate that this filesystem can be exported via NFS.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 mm/shmem.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/mm/shmem.c b/mm/shmem.c
index ec6c01378e9d2bd47db9d7506e4d6a565e092185..c64c4410b4fd9961599a5ea768b469d8184e713e 100644
--- a/mm/shmem.c
+++ b/mm/shmem.c
@@ -4477,6 +4477,7 @@ static const struct export_operations shmem_export_ops = {
 	.get_parent     = shmem_get_parent,
 	.encode_fh      = shmem_encode_fh,
 	.fh_to_dentry	= shmem_fh_to_dentry,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 enum shmem_param {

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 04/31] ext4: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (2 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 03/31] tmpfs: add EXPORT_OP_STABLE_HANDLES flag to export operations Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 05/31] ext2: " Jeff Layton
                   ` (26 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to ext4 export operations to indicate
that this filesystem can be exported via NFS.

Reviewed-by: Jan Kara <jack@suse.cz>
Acked-by: Theodore Ts'o <tytso@mit.edu>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ext4/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext4/super.c b/fs/ext4/super.c
index 87205660c5d026c3a73a64788757c288a03eaa5f..09b4c4bb8e559da087ec957de3115e4f7d450923 100644
--- a/fs/ext4/super.c
+++ b/fs/ext4/super.c
@@ -1651,6 +1651,7 @@ static const struct export_operations ext4_export_ops = {
 	.fh_to_parent = ext4_fh_to_parent,
 	.get_parent = ext4_get_parent,
 	.commit_metadata = ext4_nfs_commit_metadata,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 enum {

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 05/31] ext2: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (3 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 04/31] ext4: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 06/31] erofs: " Jeff Layton
                   ` (25 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to ext2 export operations to indicate
that this filesystem can be exported via NFS.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ext2/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ext2/super.c b/fs/ext2/super.c
index 121e634c792ab625d7a07251e572e5844242fc2a..936675f06806d268ded5a3ba5306575c437ca9ce 100644
--- a/fs/ext2/super.c
+++ b/fs/ext2/super.c
@@ -426,6 +426,7 @@ static const struct export_operations ext2_export_ops = {
 	.fh_to_dentry = ext2_fh_to_dentry,
 	.fh_to_parent = ext2_fh_to_parent,
 	.get_parent = ext2_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 enum {

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 06/31] erofs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (4 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 05/31] ext2: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 07/31] efs: " Jeff Layton
                   ` (24 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to erofs export operations to
indicate that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/erofs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/erofs/super.c b/fs/erofs/super.c
index 5136cda5972a986dece863290d20ab103791cb98..7b43ad2dd3eada8c132b26f851394492dfe4bfe3 100644
--- a/fs/erofs/super.c
+++ b/fs/erofs/super.c
@@ -608,6 +608,7 @@ static const struct export_operations erofs_export_ops = {
 	.fh_to_dentry = erofs_fh_to_dentry,
 	.fh_to_parent = erofs_fh_to_parent,
 	.get_parent = erofs_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 static void erofs_set_sysfs_name(struct super_block *sb)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 07/31] efs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (5 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 06/31] erofs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 08/31] xfs: " Jeff Layton
                   ` (23 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to efs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/efs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/efs/super.c b/fs/efs/super.c
index c59086b7eabfe93939d06f36826aa91838e41ba2..5e06acdab03b6f30bfa469e48463cb0e8a3b32a1 100644
--- a/fs/efs/super.c
+++ b/fs/efs/super.c
@@ -115,6 +115,7 @@ static const struct export_operations efs_export_ops = {
 	.fh_to_dentry	= efs_fh_to_dentry,
 	.fh_to_parent	= efs_fh_to_parent,
 	.get_parent	= efs_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 static int __init init_efs_fs(void) {

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 08/31] xfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (6 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 07/31] efs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 09/31] ceph: " Jeff Layton
                   ` (22 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to xfs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/xfs/xfs_export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/xfs/xfs_export.c b/fs/xfs/xfs_export.c
index 201489d3de0899af34f0485e00fb8b36842d419d..1be2de3394841a2960c1b2791897067b83cc7763 100644
--- a/fs/xfs/xfs_export.c
+++ b/fs/xfs/xfs_export.c
@@ -248,4 +248,5 @@ const struct export_operations xfs_export_operations = {
 	.map_blocks		= xfs_fs_map_blocks,
 	.commit_blocks		= xfs_fs_commit_blocks,
 #endif
+	.flags			= EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 09/31] ceph: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (7 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 08/31] xfs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 10/31] btrfs: " Jeff Layton
                   ` (21 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton, Viacheslav Dubeyko

Add the EXPORT_OP_STABLE_HANDLES flag to ceph export operations to indicate
that this filesystem can be exported via NFS.

Reviewed-by: Viacheslav Dubeyko <Slava.Dubeyko@ibm.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ceph/export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ceph/export.c b/fs/ceph/export.c
index b2f2af1046791d8423c91b79556bde384a2fe627..10104d20f736a8092ed847ecb27030be286c0ede 100644
--- a/fs/ceph/export.c
+++ b/fs/ceph/export.c
@@ -615,4 +615,5 @@ const struct export_operations ceph_export_ops = {
 	.fh_to_parent = ceph_fh_to_parent,
 	.get_parent = ceph_get_parent,
 	.get_name = ceph_get_name,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 10/31] btrfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (8 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 09/31] ceph: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 11/31] befs: " Jeff Layton
                   ` (20 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to btrfs export operations to
indicate that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/btrfs/export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/btrfs/export.c b/fs/btrfs/export.c
index 230d9326b685c4e12dc0fffd4a86ebba68a55bd6..14b688849ce406b2f784015afced2c29422ab6c3 100644
--- a/fs/btrfs/export.c
+++ b/fs/btrfs/export.c
@@ -304,4 +304,5 @@ const struct export_operations btrfs_export_ops = {
 	.fh_to_parent	= btrfs_fh_to_parent,
 	.get_parent	= btrfs_get_parent,
 	.get_name	= btrfs_get_name,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 11/31] befs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (9 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 10/31] btrfs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 12/31] ufs: " Jeff Layton
                   ` (19 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to befs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/befs/linuxvfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/befs/linuxvfs.c b/fs/befs/linuxvfs.c
index 9fcfdd6b8189aaf5cc3b68aa8dff4798af5bdcbc..1f358d58af8b4de9bc840b9926970340395bc9e4 100644
--- a/fs/befs/linuxvfs.c
+++ b/fs/befs/linuxvfs.c
@@ -99,6 +99,7 @@ static const struct export_operations befs_export_operations = {
 	.fh_to_dentry	= befs_fh_to_dentry,
 	.fh_to_parent	= befs_fh_to_parent,
 	.get_parent	= befs_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 /*

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 12/31] ufs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (10 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 11/31] befs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 13/31] udf: " Jeff Layton
                   ` (18 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to ufs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ufs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ufs/super.c b/fs/ufs/super.c
index 6e4585169f94bb9652aac29a14b0a64a7bb710d8..9cd9b6691849d52701058973f6b684f101df2634 100644
--- a/fs/ufs/super.c
+++ b/fs/ufs/super.c
@@ -141,6 +141,7 @@ static const struct export_operations ufs_export_ops = {
 	.fh_to_dentry	= ufs_fh_to_dentry,
 	.fh_to_parent	= ufs_fh_to_parent,
 	.get_parent	= ufs_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 #ifdef CONFIG_UFS_DEBUG

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 13/31] udf: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (11 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 12/31] ufs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 14/31] affs: " Jeff Layton
                   ` (17 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to udf export operations to indicate
that this filesystem can be exported via NFS.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/udf/namei.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/udf/namei.c b/fs/udf/namei.c
index 5f2e9a892bffa9579143cedf71d80efa7ad6e9fb..7b8db8331c77bb43d9a3c4528aee535eac2bbd37 100644
--- a/fs/udf/namei.c
+++ b/fs/udf/namei.c
@@ -1012,6 +1012,7 @@ const struct export_operations udf_export_ops = {
 	.fh_to_dentry   = udf_fh_to_dentry,
 	.fh_to_parent   = udf_fh_to_parent,
 	.get_parent     = udf_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 const struct inode_operations udf_dir_inode_operations = {

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 14/31] affs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (12 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 13/31] udf: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 15/31] squashfs: " Jeff Layton
                   ` (16 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to affs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/affs/namei.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/affs/namei.c b/fs/affs/namei.c
index f883be50db122d3b09f0ae4d24618bd49b55186b..edea4d868b5131fa69912655879231912ceff168 100644
--- a/fs/affs/namei.c
+++ b/fs/affs/namei.c
@@ -569,6 +569,7 @@ const struct export_operations affs_export_ops = {
 	.fh_to_dentry = affs_fh_to_dentry,
 	.fh_to_parent = affs_fh_to_parent,
 	.get_parent = affs_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 const struct dentry_operations affs_dentry_operations = {

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 15/31] squashfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (13 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 14/31] affs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 16/31] smb/client: " Jeff Layton
                   ` (15 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to squashfs export operations to
indicate that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/squashfs/export.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/squashfs/export.c b/fs/squashfs/export.c
index 62972f0ff8681c798f0b11e17d501373b2145bd9..c6c4d8f1f115c65b6dac29582bb5b447b823d3b8 100644
--- a/fs/squashfs/export.c
+++ b/fs/squashfs/export.c
@@ -176,5 +176,6 @@ const struct export_operations squashfs_export_ops = {
 	.encode_fh = generic_encode_ino32_fh,
 	.fh_to_dentry = squashfs_fh_to_dentry,
 	.fh_to_parent = squashfs_fh_to_parent,
-	.get_parent = squashfs_get_parent
+	.get_parent = squashfs_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 16/31] smb/client: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (14 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 15/31] squashfs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 17/31] ovl: " Jeff Layton
                   ` (14 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to cifs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/smb/client/export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/smb/client/export.c b/fs/smb/client/export.c
index d606e8cbcb7db2b4026675bd9cbc264834687807..6dfdba9fcade9e4d7ae01fd107e84956f2f9b82a 100644
--- a/fs/smb/client/export.c
+++ b/fs/smb/client/export.c
@@ -43,6 +43,7 @@ static struct dentry *cifs_get_parent(struct dentry *dentry)
 const struct export_operations cifs_export_ops = {
 	.encode_fh = generic_encode_ino32_fh,
 	.get_parent = cifs_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 /*
  * Following export operations are mandatory for NFS export support:
  *	.fh_to_dentry =

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 17/31] ovl: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (15 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 16/31] smb/client: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:42   ` Amir Goldstein
  2026-01-19 16:26 ` [PATCH v2 18/31] orangefs: " Jeff Layton
                   ` (13 subsequent siblings)
  30 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to overlayfs export operations to
indicate that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/overlayfs/export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
index 83f80fdb156749e65a4ea0ab708cbff338dacdad..18c6aee9dd23bb450dadbe8eef9360ea268241ff 100644
--- a/fs/overlayfs/export.c
+++ b/fs/overlayfs/export.c
@@ -865,6 +865,7 @@ const struct export_operations ovl_export_operations = {
 	.fh_to_parent	= ovl_fh_to_parent,
 	.get_name	= ovl_get_name,
 	.get_parent	= ovl_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 /* encode_fh() encodes non-decodable file handles with nfs_export=off */

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 18/31] orangefs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (16 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 17/31] ovl: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 19/31] ocfs2: " Jeff Layton
                   ` (12 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to orangefs export operations to
indicate that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/orangefs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/orangefs/super.c b/fs/orangefs/super.c
index b46100a4f5293576549300ae9050430c3f07969b..140f27f750939cf5538eb68501dd60012bd2daec 100644
--- a/fs/orangefs/super.c
+++ b/fs/orangefs/super.c
@@ -377,6 +377,7 @@ static int orangefs_encode_fh(struct inode *inode,
 static const struct export_operations orangefs_export_ops = {
 	.encode_fh = orangefs_encode_fh,
 	.fh_to_dentry = orangefs_fh_to_dentry,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 static int orangefs_unmount(int id, __s32 fs_id, const char *devname)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 19/31] ocfs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (17 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 18/31] orangefs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 20/31] ntfs3: " Jeff Layton
                   ` (11 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to ocfs2 export operations to
indicate that this filesystem can be exported via NFS.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ocfs2/export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ocfs2/export.c b/fs/ocfs2/export.c
index b95724b767e150e991ae4b8ea5d0505c1ae95984..77d82ff994c86037c14fbf7a1d9706f1dd2b87ac 100644
--- a/fs/ocfs2/export.c
+++ b/fs/ocfs2/export.c
@@ -280,4 +280,5 @@ const struct export_operations ocfs2_export_ops = {
 	.fh_to_dentry	= ocfs2_fh_to_dentry,
 	.fh_to_parent	= ocfs2_fh_to_parent,
 	.get_parent	= ocfs2_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 20/31] ntfs3: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (18 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 19/31] ocfs2: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 21/31] nilfs2: " Jeff Layton
                   ` (10 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to ntfs3 export operations to
indicate that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/ntfs3/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/ntfs3/super.c b/fs/ntfs3/super.c
index 8b0cf0ed4f72cc643b2b42fc491b259cf19fe3b8..df58aeb46206982cc782fad6005a13160806926d 100644
--- a/fs/ntfs3/super.c
+++ b/fs/ntfs3/super.c
@@ -889,6 +889,7 @@ static const struct export_operations ntfs_export_ops = {
 	.fh_to_parent = ntfs_fh_to_parent,
 	.get_parent = ntfs3_get_parent,
 	.commit_metadata = ntfs_nfs_commit_metadata,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 /*

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 21/31] nilfs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (19 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 20/31] ntfs3: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 22/31] nfs: " Jeff Layton
                   ` (9 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to nilfs2 export operations to
indicate that this filesystem can be exported via NFS.

Acked-by: Ryusuke Konishi <konishi.ryusuke@gmail.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nilfs2/namei.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/nilfs2/namei.c b/fs/nilfs2/namei.c
index 40f4b1a28705b6e0eb8f0978cf3ac18b43aa1331..975123586d1b1703e25ba6dd3117f397b3d785c1 100644
--- a/fs/nilfs2/namei.c
+++ b/fs/nilfs2/namei.c
@@ -591,4 +591,5 @@ const struct export_operations nilfs_export_ops = {
 	.fh_to_dentry = nilfs_fh_to_dentry,
 	.fh_to_parent = nilfs_fh_to_parent,
 	.get_parent = nilfs_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 22/31] nfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (20 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 21/31] nilfs2: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 23/31] jfs: " Jeff Layton
                   ` (8 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to nfs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfs/export.c | 3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/fs/nfs/export.c b/fs/nfs/export.c
index a10dd5f9d0786eb111113bf524a1af8b7da0fb6e..7592ef347a2eae5d6305b64effd22537d5ef5e74 100644
--- a/fs/nfs/export.c
+++ b/fs/nfs/export.c
@@ -162,5 +162,6 @@ const struct export_operations nfs_export_ops = {
 		 EXPORT_OP_REMOTE_FS		|
 		 EXPORT_OP_NOATOMIC_ATTR	|
 		 EXPORT_OP_FLUSH_ON_CLOSE	|
-		 EXPORT_OP_NOLOCKS,
+		 EXPORT_OP_NOLOCKS		|
+		 EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 23/31] jfs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (21 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 22/31] nfs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 24/31] jffs2: " Jeff Layton
                   ` (7 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton, Dave Kleikamp

Add the EXPORT_OP_STABLE_HANDLES flag to jfs export operations to indicate
that this filesystem can be exported via NFS.

Acked-by: Dave Kleikamp <dave.kleikamp@oracle.com>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/jfs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/jfs/super.c b/fs/jfs/super.c
index 3cfb86c5a36e8f0c46a2734a24fba6ffd36c7ad9..ac9b6d754f8c203baa7e91362aeb0dc9b3ce209f 100644
--- a/fs/jfs/super.c
+++ b/fs/jfs/super.c
@@ -864,6 +864,7 @@ static const struct export_operations jfs_export_operations = {
 	.fh_to_dentry	= jfs_fh_to_dentry,
 	.fh_to_parent	= jfs_fh_to_parent,
 	.get_parent	= jfs_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 static void jfs_init_options(struct fs_context *fc, struct jfs_context *ctx)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 24/31] jffs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (22 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 23/31] jfs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 25/31] isofs: " Jeff Layton
                   ` (6 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to jffs2 export operations to
indicate that this filesystem can be exported via NFS.

Acked-by: Richard Weinberger <richard@nod.at>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/jffs2/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/jffs2/super.c b/fs/jffs2/super.c
index 4545f885c41efa1d925afc1d643576d859c42921..80ff5a0130603f94c9bce452c976753c85314c3a 100644
--- a/fs/jffs2/super.c
+++ b/fs/jffs2/super.c
@@ -155,6 +155,7 @@ static const struct export_operations jffs2_export_ops = {
 	.get_parent = jffs2_get_parent,
 	.fh_to_dentry = jffs2_fh_to_dentry,
 	.fh_to_parent = jffs2_fh_to_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 /*

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 25/31] isofs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (23 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 24/31] jffs2: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 26/31] gfs2: " Jeff Layton
                   ` (5 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to isofs export operations to
indicate that this filesystem can be exported via NFS.

Reviewed-by: Jan Kara <jack@suse.cz>
Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/isofs/export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/isofs/export.c b/fs/isofs/export.c
index 421d247fae52301b778f0589b27fcf48f2372832..7c17eb4e030813d1d22456ccbfb005c6b6934500 100644
--- a/fs/isofs/export.c
+++ b/fs/isofs/export.c
@@ -190,4 +190,5 @@ const struct export_operations isofs_export_ops = {
 	.fh_to_dentry	= isofs_fh_to_dentry,
 	.fh_to_parent	= isofs_fh_to_parent,
 	.get_parent     = isofs_export_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 26/31] gfs2: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (24 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 25/31] isofs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 27/31] fuse: " Jeff Layton
                   ` (4 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to gfs2 export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/gfs2/export.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/gfs2/export.c b/fs/gfs2/export.c
index 3334c394ce9cbe26969809874a94e79bf068b11b..43fd2203b34fb0894d2b71e50278e5cd68216ce7 100644
--- a/fs/gfs2/export.c
+++ b/fs/gfs2/export.c
@@ -190,5 +190,6 @@ const struct export_operations gfs2_export_ops = {
 	.fh_to_parent = gfs2_fh_to_parent,
 	.get_name = gfs2_get_name,
 	.get_parent = gfs2_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 27/31] fuse: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (25 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 26/31] gfs2: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:43   ` Amir Goldstein
  2026-01-19 16:26 ` [PATCH v2 28/31] fat: " Jeff Layton
                   ` (3 subsequent siblings)
  30 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to fuse export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/fuse/inode.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
index 819e50d666224a6201cfc7f450e0bd37bfe32810..df92414e903b200fedb9dc777b913dae1e2d0741 100644
--- a/fs/fuse/inode.c
+++ b/fs/fuse/inode.c
@@ -1215,6 +1215,7 @@ static const struct export_operations fuse_export_operations = {
 	.fh_to_parent	= fuse_fh_to_parent,
 	.encode_fh	= fuse_encode_fh,
 	.get_parent	= fuse_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 static const struct super_operations fuse_super_operations = {

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 28/31] fat: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (26 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 27/31] fuse: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 29/31] f2fs: " Jeff Layton
                   ` (2 subsequent siblings)
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to fat export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/fat/nfs.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/fs/fat/nfs.c b/fs/fat/nfs.c
index 509eea96a457d41f63f04480da32aceae75a8a4a..f6a5c8c4f5e8a14e549b5aad6643d490f1d062b1 100644
--- a/fs/fat/nfs.c
+++ b/fs/fat/nfs.c
@@ -289,6 +289,7 @@ const struct export_operations fat_export_ops = {
 	.fh_to_dentry   = fat_fh_to_dentry,
 	.fh_to_parent   = fat_fh_to_parent,
 	.get_parent     = fat_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };
 
 const struct export_operations fat_export_ops_nostale = {
@@ -296,4 +297,5 @@ const struct export_operations fat_export_ops_nostale = {
 	.fh_to_dentry   = fat_fh_to_dentry_nostale,
 	.fh_to_parent   = fat_fh_to_parent_nostale,
 	.get_parent     = fat_get_parent,
+	.flags		= EXPORT_OP_STABLE_HANDLES,
 };

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 29/31] f2fs: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (27 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 28/31] fat: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 30/31] nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES Jeff Layton
  2026-01-19 16:26 ` [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints Jeff Layton
  30 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Add the EXPORT_OP_STABLE_HANDLES flag to f2fs export operations to indicate
that this filesystem can be exported via NFS.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/f2fs/super.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/f2fs/super.c b/fs/f2fs/super.c
index c4c225e09dc4701f009dec4338f2eaba1820ea7d..260c26771c431bbb36e99be8daff6cde40662751 100644
--- a/fs/f2fs/super.c
+++ b/fs/f2fs/super.c
@@ -3750,6 +3750,7 @@ static const struct export_operations f2fs_export_ops = {
 	.fh_to_dentry = f2fs_fh_to_dentry,
 	.fh_to_parent = f2fs_fh_to_parent,
 	.get_parent = f2fs_get_parent,
+	.flags = EXPORT_OP_STABLE_HANDLES,
 };
 
 loff_t max_file_blocks(struct inode *inode)

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 30/31] nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (28 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 29/31] f2fs: " Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:51   ` Chuck Lever
  2026-01-19 16:26 ` [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints Jeff Layton
  30 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Some filesystems have grown export operations in order to provide
filehandles for local usage. Some of these filesystems are unsuitable
for use with nfsd, since their filehandles are not stable across
reboots.

In check_export(), check whether EXPORT_OP_STABLE_HANDLES is set
and return -EINVAL if it isn't.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/export.c | 15 +++++++++++----
 1 file changed, 11 insertions(+), 4 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index 2a1499f2ad196a6033787260881e451146283bdc..bc703cf58bfa210c7c57d49f22f15bc10d7cfc91 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -422,13 +422,15 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
 	if (*flags & NFSEXP_V4ROOT)
 		*flags |= NFSEXP_READONLY;
 
-	/* There are two requirements on a filesystem to be exportable.
-	 * 1:  We must be able to identify the filesystem from a number.
+	/* There are four requirements on a filesystem to be exportable:
+	 * 1: We must be able to identify the filesystem from a number.
 	 *       either a device number (so FS_REQUIRES_DEV needed)
 	 *       or an FSID number (so NFSEXP_FSID or ->uuid is needed).
-	 * 2:  We must be able to find an inode from a filehandle.
+	 * 2: We must be able to find an inode from a filehandle.
 	 *       This means that s_export_op must be set.
-	 * 3: We must not currently be on an idmapped mount.
+	 * 3: It must provide stable filehandles.
+	 *       This means that EXPORT_OP_STABLE_HANDLES is set
+	 * 4: We must not currently be on an idmapped mount.
 	 */
 	if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) &&
 	    !(*flags & NFSEXP_FSID) &&
@@ -442,6 +444,11 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
 		return -EINVAL;
 	}
 
+	if (!(inode->i_sb->s_export_op->flags & EXPORT_OP_STABLE_HANDLES)) {
+		dprintk("%s: fs does not provide stable filehandles!\n", __func__);
+		return -EINVAL;
+	}
+
 	if (is_idmapped_mnt(path->mnt)) {
 		dprintk("exp_export: export of idmapped mounts not yet supported.\n");
 		return -EINVAL;

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints
  2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
                   ` (29 preceding siblings ...)
  2026-01-19 16:26 ` [PATCH v2 30/31] nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES Jeff Layton
@ 2026-01-19 16:26 ` Jeff Layton
  2026-01-19 16:47   ` Chuck Lever
  30 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-19 16:26 UTC (permalink / raw)
  To: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc,
	Jeff Layton

Get rid of the dprintk messages in check_export(). Instead add new
tracepoints that show the terminal inode and the flags.

Signed-off-by: Jeff Layton <jlayton@kernel.org>
---
 fs/nfsd/export.c | 11 ++++++-----
 fs/nfsd/trace.h  | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 58 insertions(+), 5 deletions(-)

diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
index bc703cf58bfa210c7c57d49f22f15bc10d7cfc91..3cc336b953b38573966c43000f31cd341380837b 100644
--- a/fs/nfsd/export.c
+++ b/fs/nfsd/export.c
@@ -435,31 +435,32 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
 	if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) &&
 	    !(*flags & NFSEXP_FSID) &&
 	    uuid == NULL) {
-		dprintk("exp_export: export of non-dev fs without fsid\n");
+		trace_nfsd_check_export_need_fsid(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) {
-		dprintk("exp_export: export of invalid fs type.\n");
+		trace_nfsd_check_export_invalid_fstype(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (!(inode->i_sb->s_export_op->flags & EXPORT_OP_STABLE_HANDLES)) {
-		dprintk("%s: fs does not provide stable filehandles!\n", __func__);
+		trace_nfsd_check_export_no_stable_fh(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (is_idmapped_mnt(path->mnt)) {
 		dprintk("exp_export: export of idmapped mounts not yet supported.\n");
+		trace_nfsd_check_export_idmapped(inode, *flags);
 		return -EINVAL;
 	}
 
 	if (inode->i_sb->s_export_op->flags & EXPORT_OP_NOSUBTREECHK &&
 	    !(*flags & NFSEXP_NOSUBTREECHECK)) {
-		dprintk("%s: %s does not support subtree checking!\n",
-			__func__, inode->i_sb->s_type->name);
+		trace_nfsd_check_export_subtree(inode, *flags);
 		return -EINVAL;
 	}
+	trace_nfsd_check_export_success(inode, *flags);
 	return 0;
 }
 
diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
index 5ae2a611e57f4b4e51a4d9eb6e0fccb66ad8d288..e3f5fe1181b605b34cb70d53f32739c3ef9b82f6 100644
--- a/fs/nfsd/trace.h
+++ b/fs/nfsd/trace.h
@@ -339,6 +339,58 @@ DEFINE_EVENT_CONDITION(nfsd_fh_err_class, nfsd_##name,	\
 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport);
 DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle);
 
+#define show_export_flags(val)						\
+	__print_flags(val, "|",						\
+		{ NFSEXP_READONLY,		"READONLY" },		\
+		{ NFSEXP_INSECURE_PORT,		"INSECURE" },		\
+		{ NFSEXP_ROOTSQUASH,		"ROOTSQUASH" },		\
+		{ NFSEXP_ALLSQUASH,		"ALLSQUASH" },		\
+		{ NFSEXP_ASYNC,			"ASYNC" },		\
+		{ NFSEXP_GATHERED_WRITES,	"GATHERED_WRITES" },	\
+		{ NFSEXP_NOREADDIRPLUS,		"NOREADDIRPLUS" },	\
+		{ NFSEXP_SECURITY_LABEL,	"SECURITY_LABEL" },	\
+		{ NFSEXP_NOHIDE,		"NOHIDE" },		\
+		{ NFSEXP_NOSUBTREECHECK,	"NOSUBTREECHECK" },	\
+		{ NFSEXP_NOAUTHNLM,		"NOAUTHNLM" },		\
+		{ NFSEXP_MSNFS,			"MSNFS" },		\
+		{ NFSEXP_FSID,			"FSID" },		\
+		{ NFSEXP_CROSSMOUNT,		"CROSSMOUNT" },		\
+		{ NFSEXP_NOACL,			"NOACL" },		\
+		{ NFSEXP_V4ROOT,		"V4ROOT" },		\
+		{ NFSEXP_PNFS,			"PNFS" })
+
+DECLARE_EVENT_CLASS(nfsd_check_export_class,
+	TP_PROTO(const struct inode *inode,
+		 int flags),
+	TP_ARGS(inode, flags),
+	TP_STRUCT__entry(
+		__field(dev_t, dev)
+		__field(ino_t, ino)
+		__field(int, flags)
+	),
+	TP_fast_assign(
+		__entry->dev = inode->i_sb->s_dev;
+		__entry->ino = inode->i_ino;
+		__entry->flags = flags;
+	),
+	TP_printk("dev=%u:%u:%lu flags=%s",
+		  MAJOR(__entry->dev), MINOR(__entry->dev),
+		  __entry->ino, show_export_flags(__entry->flags))
+)
+
+#define DEFINE_NFSD_CHECK_EXPORT_EVENT(name)			\
+DEFINE_EVENT(nfsd_check_export_class, nfsd_check_export_##name,	\
+	TP_PROTO(const struct inode *inode,			\
+		 int flags),					\
+	TP_ARGS(inode, flags))
+
+DEFINE_NFSD_CHECK_EXPORT_EVENT(need_fsid);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(invalid_fstype);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(no_stable_fh);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(idmapped);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(subtree);
+DEFINE_NFSD_CHECK_EXPORT_EVENT(success);
+
 TRACE_EVENT(nfsd_exp_find_key,
 	TP_PROTO(const struct svc_expkey *key,
 		 int status),

-- 
2.52.0



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag
  2026-01-19 16:26 ` [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag Jeff Layton
@ 2026-01-19 16:41   ` Amir Goldstein
  2026-01-20  7:50   ` Christoph Hellwig
  1 sibling, 0 replies; 50+ messages in thread
From: Amir Goldstein @ 2026-01-19 16:41 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Hugh Dickins,
	Baolin Wang, Andrew Morton, Theodore Ts'o, Andreas Dilger,
	Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Sandeep Dhavale,
	Hongbo Li, Chunhai Guo, Carlos Maiolino, Ilya Dryomov,
	Alex Markuze, Viacheslav Dubeyko, Chris Mason, David Sterba,
	Luis de Bethencourt, Salah Triki, Phillip Lougher, Steve French,
	Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Miklos Szeredi, Mike Marshall, Martin Brandenburg, Mark Fasheh,
	Joel Becker, Joseph Qi, Konstantin Komarov, Ryusuke Konishi,
	Trond Myklebust, Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, Christoph Hellwig, linux-nfs, linux-kernel,
	linux-fsdevel, linux-mm, linux-ext4, linux-erofs, linux-xfs,
	ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Mon, Jan 19, 2026 at 5:27 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> At one time, nfsd could take the presence of struct export_operations to
> be an indicator that a filesystem was exportable via NFS. Since then, a
> lot of filesystems have grown export operations in order to provide
> filehandle support. Some of those (e.g. kernfs, pidfs, and nsfs) are not
> suitable for export via NFS since they lack filehandles that are
> stable across reboot.
>
> Add a new EXPORT_OP_STABLE_HANDLES flag that indicates that the
> filesystem supports perisistent filehandles,

persistent still here?
"...are stable across the lifetime of a file"?

> a requirement for nfs
> export. While in there, switch to the BIT() macro for defining these
> flags.

Maybe you want to move that cleanup to patch 1 along with the
export.rst sync? not a must.

>
> For now, the flag is not checked anywhere. That will come later after
> we've added it to the existing filesystems that need to remain
> exportable.
>
> Reviewed-by: Jan Kara <jack@suse.cz>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  Documentation/filesystems/nfs/exporting.rst |  7 +++++++
>  include/linux/exportfs.h                    | 16 +++++++++-------
>  2 files changed, 16 insertions(+), 7 deletions(-)
>
> diff --git a/Documentation/filesystems/nfs/exporting.rst b/Documentation/filesystems/nfs/exporting.rst
> index 0583a0516b1e3a3e6a10af95ff88506cf02f7df4..0c29ee44e3484cef84d2d3d47819acf172d275a3 100644
> --- a/Documentation/filesystems/nfs/exporting.rst
> +++ b/Documentation/filesystems/nfs/exporting.rst
> @@ -244,3 +244,10 @@ following flags are defined:
>      nfsd. A case in point is reexport of NFS itself, which can't be done
>      safely without coordinating the grace period handling. Other clustered
>      and networked filesystems can be problematic here as well.
> +
> +  EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
> +    stable across the lifetime of a file. This is a hard requirement for export
> +    via nfsd. Any filesystem that is eligible to be exported via nfsd must
> +    indicate this guarantee by setting this flag. Most disk-based filesystems
> +    can do this naturally. Pseudofilesystems that are for local reporting and
> +    control (e.g. kernfs, pidfs, nsfs) usually can't support this.
> diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
> index f0cf2714ec52dd942b8f1c455a25702bd7e412b3..c4e0f083290e7e341342cf0b45b58fddda3af65e 100644
> --- a/include/linux/exportfs.h
> +++ b/include/linux/exportfs.h
> @@ -3,6 +3,7 @@
>  #define LINUX_EXPORTFS_H 1
>
>  #include <linux/types.h>
> +#include <linux/bits.h>
>  #include <linux/path.h>
>
>  struct dentry;
> @@ -277,15 +278,16 @@ struct export_operations {
>                              int nr_iomaps, struct iattr *iattr);
>         int (*permission)(struct handle_to_path_ctx *ctx, unsigned int oflags);
>         struct file * (*open)(const struct path *path, unsigned int oflags);
> -#define        EXPORT_OP_NOWCC                 (0x1) /* don't collect v3 wcc data */
> -#define        EXPORT_OP_NOSUBTREECHK          (0x2) /* no subtree checking */
> -#define        EXPORT_OP_CLOSE_BEFORE_UNLINK   (0x4) /* close files before unlink */
> -#define EXPORT_OP_REMOTE_FS            (0x8) /* Filesystem is remote */
> -#define EXPORT_OP_NOATOMIC_ATTR                (0x10) /* Filesystem cannot supply
> +#define EXPORT_OP_NOWCC                        BIT(0) /* don't collect v3 wcc data */
> +#define EXPORT_OP_NOSUBTREECHK         BIT(1) /* no subtree checking */
> +#define EXPORT_OP_CLOSE_BEFORE_UNLINK  BIT(2) /* close files before unlink */
> +#define EXPORT_OP_REMOTE_FS            BIT(3) /* Filesystem is remote */
> +#define EXPORT_OP_NOATOMIC_ATTR                BIT(4) /* Filesystem cannot supply
>                                                   atomic attribute updates
>                                                 */
> -#define EXPORT_OP_FLUSH_ON_CLOSE       (0x20) /* fs flushes file data on close */
> -#define EXPORT_OP_NOLOCKS              (0x40) /* no file locking support */
> +#define EXPORT_OP_FLUSH_ON_CLOSE       BIT(5) /* fs flushes file data on close */
> +#define EXPORT_OP_NOLOCKS              BIT(6) /* no file locking support */
> +#define EXPORT_OP_STABLE_HANDLES       BIT(7) /* fhs are stable across reboot */
>         unsigned long   flags;
>  };
>
>
> --
> 2.52.0
>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 17/31] ovl: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 ` [PATCH v2 17/31] ovl: " Jeff Layton
@ 2026-01-19 16:42   ` Amir Goldstein
  0 siblings, 0 replies; 50+ messages in thread
From: Amir Goldstein @ 2026-01-19 16:42 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Hugh Dickins,
	Baolin Wang, Andrew Morton, Theodore Ts'o, Andreas Dilger,
	Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Sandeep Dhavale,
	Hongbo Li, Chunhai Guo, Carlos Maiolino, Ilya Dryomov,
	Alex Markuze, Viacheslav Dubeyko, Chris Mason, David Sterba,
	Luis de Bethencourt, Salah Triki, Phillip Lougher, Steve French,
	Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Miklos Szeredi, Mike Marshall, Martin Brandenburg, Mark Fasheh,
	Joel Becker, Joseph Qi, Konstantin Komarov, Ryusuke Konishi,
	Trond Myklebust, Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, Christoph Hellwig, linux-nfs, linux-kernel,
	linux-fsdevel, linux-mm, linux-ext4, linux-erofs, linux-xfs,
	ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Mon, Jan 19, 2026 at 5:29 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> Add the EXPORT_OP_STABLE_HANDLES flag to overlayfs export operations to
> indicate that this filesystem can be exported via NFS.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>

> ---
>  fs/overlayfs/export.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/overlayfs/export.c b/fs/overlayfs/export.c
> index 83f80fdb156749e65a4ea0ab708cbff338dacdad..18c6aee9dd23bb450dadbe8eef9360ea268241ff 100644
> --- a/fs/overlayfs/export.c
> +++ b/fs/overlayfs/export.c
> @@ -865,6 +865,7 @@ const struct export_operations ovl_export_operations = {
>         .fh_to_parent   = ovl_fh_to_parent,
>         .get_name       = ovl_get_name,
>         .get_parent     = ovl_get_parent,
> +       .flags          = EXPORT_OP_STABLE_HANDLES,
>  };
>
>  /* encode_fh() encodes non-decodable file handles with nfs_export=off */
>
> --
> 2.52.0
>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 27/31] fuse: add EXPORT_OP_STABLE_HANDLES flag to export operations
  2026-01-19 16:26 ` [PATCH v2 27/31] fuse: " Jeff Layton
@ 2026-01-19 16:43   ` Amir Goldstein
  0 siblings, 0 replies; 50+ messages in thread
From: Amir Goldstein @ 2026-01-19 16:43 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Hugh Dickins,
	Baolin Wang, Andrew Morton, Theodore Ts'o, Andreas Dilger,
	Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Sandeep Dhavale,
	Hongbo Li, Chunhai Guo, Carlos Maiolino, Ilya Dryomov,
	Alex Markuze, Viacheslav Dubeyko, Chris Mason, David Sterba,
	Luis de Bethencourt, Salah Triki, Phillip Lougher, Steve French,
	Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Miklos Szeredi, Mike Marshall, Martin Brandenburg, Mark Fasheh,
	Joel Becker, Joseph Qi, Konstantin Komarov, Ryusuke Konishi,
	Trond Myklebust, Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, Christoph Hellwig, linux-nfs, linux-kernel,
	linux-fsdevel, linux-mm, linux-ext4, linux-erofs, linux-xfs,
	ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Mon, Jan 19, 2026 at 5:30 PM Jeff Layton <jlayton@kernel.org> wrote:
>
> Add the EXPORT_OP_STABLE_HANDLES flag to fuse export operations to indicate
> that this filesystem can be exported via NFS.
>
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
Reviewed-by: Amir Goldstein <amir73il@gmail.com>

> ---
>  fs/fuse/inode.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/fs/fuse/inode.c b/fs/fuse/inode.c
> index 819e50d666224a6201cfc7f450e0bd37bfe32810..df92414e903b200fedb9dc777b913dae1e2d0741 100644
> --- a/fs/fuse/inode.c
> +++ b/fs/fuse/inode.c
> @@ -1215,6 +1215,7 @@ static const struct export_operations fuse_export_operations = {
>         .fh_to_parent   = fuse_fh_to_parent,
>         .encode_fh      = fuse_encode_fh,
>         .get_parent     = fuse_get_parent,
> +       .flags          = EXPORT_OP_STABLE_HANDLES,
>  };
>
>  static const struct super_operations fuse_super_operations = {
>
> --
> 2.52.0
>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints
  2026-01-19 16:26 ` [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints Jeff Layton
@ 2026-01-19 16:47   ` Chuck Lever
  2026-01-20 13:42     ` Jeff Layton
  0 siblings, 1 reply; 50+ messages in thread
From: Chuck Lever @ 2026-01-19 16:47 UTC (permalink / raw)
  To: Jeff Layton, Christian Brauner, Alexander Viro, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On 1/19/26 11:26 AM, Jeff Layton wrote:
> Get rid of the dprintk messages in check_export(). Instead add new
> tracepoints that show the terminal inode and the flags.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/nfsd/export.c | 11 ++++++-----
>  fs/nfsd/trace.h  | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
>  2 files changed, 58 insertions(+), 5 deletions(-)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index bc703cf58bfa210c7c57d49f22f15bc10d7cfc91..3cc336b953b38573966c43000f31cd341380837b 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -435,31 +435,32 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
>  	if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) &&
>  	    !(*flags & NFSEXP_FSID) &&
>  	    uuid == NULL) {
> -		dprintk("exp_export: export of non-dev fs without fsid\n");
> +		trace_nfsd_check_export_need_fsid(inode, *flags);
>  		return -EINVAL;
>  	}
>  
>  	if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) {
> -		dprintk("exp_export: export of invalid fs type.\n");
> +		trace_nfsd_check_export_invalid_fstype(inode, *flags);
>  		return -EINVAL;
>  	}
>  
>  	if (!(inode->i_sb->s_export_op->flags & EXPORT_OP_STABLE_HANDLES)) {
> -		dprintk("%s: fs does not provide stable filehandles!\n", __func__);
> +		trace_nfsd_check_export_no_stable_fh(inode, *flags);
>  		return -EINVAL;
>  	}
>  
>  	if (is_idmapped_mnt(path->mnt)) {
>  		dprintk("exp_export: export of idmapped mounts not yet supported.\n");
> +		trace_nfsd_check_export_idmapped(inode, *flags);
>  		return -EINVAL;
>  	}
>  
>  	if (inode->i_sb->s_export_op->flags & EXPORT_OP_NOSUBTREECHK &&
>  	    !(*flags & NFSEXP_NOSUBTREECHECK)) {
> -		dprintk("%s: %s does not support subtree checking!\n",
> -			__func__, inode->i_sb->s_type->name);
> +		trace_nfsd_check_export_subtree(inode, *flags);
>  		return -EINVAL;
>  	}
> +	trace_nfsd_check_export_success(inode, *flags);
>  	return 0;
>  }
>  
> diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
> index 5ae2a611e57f4b4e51a4d9eb6e0fccb66ad8d288..e3f5fe1181b605b34cb70d53f32739c3ef9b82f6 100644
> --- a/fs/nfsd/trace.h
> +++ b/fs/nfsd/trace.h
> @@ -339,6 +339,58 @@ DEFINE_EVENT_CONDITION(nfsd_fh_err_class, nfsd_##name,	\
>  DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport);
>  DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle);
>  
> +#define show_export_flags(val)						\

Whacky. I thought we had one of these already, but I can't find one.


> +	__print_flags(val, "|",						\
> +		{ NFSEXP_READONLY,		"READONLY" },		\
> +		{ NFSEXP_INSECURE_PORT,		"INSECURE" },		\
> +		{ NFSEXP_ROOTSQUASH,		"ROOTSQUASH" },		\
> +		{ NFSEXP_ALLSQUASH,		"ALLSQUASH" },		\
> +		{ NFSEXP_ASYNC,			"ASYNC" },		\
> +		{ NFSEXP_GATHERED_WRITES,	"GATHERED_WRITES" },	\
> +		{ NFSEXP_NOREADDIRPLUS,		"NOREADDIRPLUS" },	\
> +		{ NFSEXP_SECURITY_LABEL,	"SECURITY_LABEL" },	\
> +		{ NFSEXP_NOHIDE,		"NOHIDE" },		\
> +		{ NFSEXP_NOSUBTREECHECK,	"NOSUBTREECHECK" },	\
> +		{ NFSEXP_NOAUTHNLM,		"NOAUTHNLM" },		\
> +		{ NFSEXP_MSNFS,			"MSNFS" },		\
> +		{ NFSEXP_FSID,			"FSID" },		\
> +		{ NFSEXP_CROSSMOUNT,		"CROSSMOUNT" },		\
> +		{ NFSEXP_NOACL,			"NOACL" },		\
> +		{ NFSEXP_V4ROOT,		"V4ROOT" },		\
> +		{ NFSEXP_PNFS,			"PNFS" })
> +
> +DECLARE_EVENT_CLASS(nfsd_check_export_class,
> +	TP_PROTO(const struct inode *inode,
> +		 int flags),
> +	TP_ARGS(inode, flags),
> +	TP_STRUCT__entry(
> +		__field(dev_t, dev)
> +		__field(ino_t, ino)
> +		__field(int, flags)
> +	),
> +	TP_fast_assign(
> +		__entry->dev = inode->i_sb->s_dev;
> +		__entry->ino = inode->i_ino;
> +		__entry->flags = flags;
> +	),
> +	TP_printk("dev=%u:%u:%lu flags=%s",
> +		  MAJOR(__entry->dev), MINOR(__entry->dev),
> +		  __entry->ino, show_export_flags(__entry->flags))
> +)
> +
> +#define DEFINE_NFSD_CHECK_EXPORT_EVENT(name)			\
> +DEFINE_EVENT(nfsd_check_export_class, nfsd_check_export_##name,	\
> +	TP_PROTO(const struct inode *inode,			\
> +		 int flags),					\
> +	TP_ARGS(inode, flags))
> +
> +DEFINE_NFSD_CHECK_EXPORT_EVENT(need_fsid);
> +DEFINE_NFSD_CHECK_EXPORT_EVENT(invalid_fstype);
> +DEFINE_NFSD_CHECK_EXPORT_EVENT(no_stable_fh);
> +DEFINE_NFSD_CHECK_EXPORT_EVENT(idmapped);
> +DEFINE_NFSD_CHECK_EXPORT_EVENT(subtree);
> +DEFINE_NFSD_CHECK_EXPORT_EVENT(success);
> +
>  TRACE_EVENT(nfsd_exp_find_key,
>  	TP_PROTO(const struct svc_expkey *key,
>  		 int status),
> 

'Twould be nice to report the namespace or client address that
was making the failing request, but maybe that information is
not available in check_export.

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>


-- 
Chuck Lever


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 30/31] nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES
  2026-01-19 16:26 ` [PATCH v2 30/31] nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES Jeff Layton
@ 2026-01-19 16:51   ` Chuck Lever
  0 siblings, 0 replies; 50+ messages in thread
From: Chuck Lever @ 2026-01-19 16:51 UTC (permalink / raw)
  To: Jeff Layton, Christian Brauner, Alexander Viro, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On 1/19/26 11:26 AM, Jeff Layton wrote:
> Some filesystems have grown export operations in order to provide
> filehandles for local usage. Some of these filesystems are unsuitable
> for use with nfsd, since their filehandles are not stable across
> reboots.
> 
> In check_export(), check whether EXPORT_OP_STABLE_HANDLES is set
> and return -EINVAL if it isn't.
> 
> Signed-off-by: Jeff Layton <jlayton@kernel.org>
> ---
>  fs/nfsd/export.c | 15 +++++++++++----
>  1 file changed, 11 insertions(+), 4 deletions(-)
> 
> diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> index 2a1499f2ad196a6033787260881e451146283bdc..bc703cf58bfa210c7c57d49f22f15bc10d7cfc91 100644
> --- a/fs/nfsd/export.c
> +++ b/fs/nfsd/export.c
> @@ -422,13 +422,15 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
>  	if (*flags & NFSEXP_V4ROOT)
>  		*flags |= NFSEXP_READONLY;
>  
> -	/* There are two requirements on a filesystem to be exportable.
> -	 * 1:  We must be able to identify the filesystem from a number.
> +	/* There are four requirements on a filesystem to be exportable:
> +	 * 1: We must be able to identify the filesystem from a number.
>  	 *       either a device number (so FS_REQUIRES_DEV needed)
>  	 *       or an FSID number (so NFSEXP_FSID or ->uuid is needed).
> -	 * 2:  We must be able to find an inode from a filehandle.
> +	 * 2: We must be able to find an inode from a filehandle.
>  	 *       This means that s_export_op must be set.
> -	 * 3: We must not currently be on an idmapped mount.
> +	 * 3: It must provide stable filehandles.
> +	 *       This means that EXPORT_OP_STABLE_HANDLES is set
> +	 * 4: We must not currently be on an idmapped mount.
>  	 */

Let's avoid the royal "we" here... It seems to mean something
different in each of these rules. How about:

1. The filehandle must identify a filesystem by number

2. The filehandle must uniquely identify an inode

3. The exported filesystem must provide stable filehandles

4. The requested file must not reside on an idmapped mount


>  	if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) &&
>  	    !(*flags & NFSEXP_FSID) &&
> @@ -442,6 +444,11 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
>  		return -EINVAL;
>  	}
>  
> +	if (!(inode->i_sb->s_export_op->flags & EXPORT_OP_STABLE_HANDLES)) {
> +		dprintk("%s: fs does not provide stable filehandles!\n", __func__);
> +		return -EINVAL;
> +	}
> +
>  	if (is_idmapped_mnt(path->mnt)) {
>  		dprintk("exp_export: export of idmapped mounts not yet supported.\n");
>  		return -EINVAL;
> 

Reviewed-by: Chuck Lever <chuck.lever@oracle.com>


-- 
Chuck Lever


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-19 16:26 ` [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS Jeff Layton
@ 2026-01-20  7:44   ` Christoph Hellwig
  2026-01-20 13:20     ` Jeff Layton
  0 siblings, 1 reply; 50+ messages in thread
From: Christoph Hellwig @ 2026-01-20  7:44 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet, David Laight, Dave Chinner, Christoph Hellwig,
	linux-nfs, linux-kernel, linux-fsdevel, linux-mm, linux-ext4,
	linux-erofs, linux-xfs, ceph-devel, linux-btrfs, linux-cifs,
	samba-technical, linux-unionfs, devel, ocfs2-devel, ntfs3,
	linux-nilfs, jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel,
	linux-doc

On Mon, Jan 19, 2026 at 11:26:18AM -0500, Jeff Layton wrote:
> +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
> +    filesystems cannot properly support file locking as implemented by
> +    nfsd. A case in point is reexport of NFS itself, which can't be done
> +    safely without coordinating the grace period handling. Other clustered
> +    and networked filesystems can be problematic here as well.

I'm not sure this is very useful.  It really needs to document what
locking semantics nfs expects, because otherwise no reader will know
if they set this or not.



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag
  2026-01-19 16:26 ` [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag Jeff Layton
  2026-01-19 16:41   ` Amir Goldstein
@ 2026-01-20  7:50   ` Christoph Hellwig
  2026-01-20  8:40     ` Jan Kara
  2026-01-20 13:21     ` Jeff Layton
  1 sibling, 2 replies; 50+ messages in thread
From: Christoph Hellwig @ 2026-01-20  7:50 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet, David Laight, Dave Chinner, Christoph Hellwig,
	linux-nfs, linux-kernel, linux-fsdevel, linux-mm, linux-ext4,
	linux-erofs, linux-xfs, ceph-devel, linux-btrfs, linux-cifs,
	samba-technical, linux-unionfs, devel, ocfs2-devel, ntfs3,
	linux-nilfs, jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel,
	linux-doc

On Mon, Jan 19, 2026 at 11:26:19AM -0500, Jeff Layton wrote:
> +  EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
> +    stable across the lifetime of a file. This is a hard requirement for export
> +    via nfsd. Any filesystem that is eligible to be exported via nfsd must
> +    indicate this guarantee by setting this flag. Most disk-based filesystems
> +    can do this naturally. Pseudofilesystems that are for local reporting and
> +    control (e.g. kernfs, pidfs, nsfs) usually can't support this.

Suggested rewording, taking some of the ideas from Dave Chinners earlier
comments into account:

  EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
    stable across the lifetime of a file.  A file in this context is an
    instantiated inode reachable by one or more file names, or still open after
    the last name has been unlinked.  Reuses of the same on-disk inode structure
    are considered new files and must provide different file handles from the
    previous incarnation.  Most file systems designed to store user data
    naturally provide this capability.  Pseudofilesystems that are for local
    reporting and control (e.g. kernfs, pidfs, nsfs) usually can't support this.

    This flags is a hard requirement for export via nfsd. Any filesystem that
    is eligible to be exported via nfsd must indicate this guarantee by
    setting this flag.



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag
  2026-01-20  7:50   ` Christoph Hellwig
@ 2026-01-20  8:40     ` Jan Kara
  2026-01-21  9:17       ` Christoph Hellwig
  2026-01-20 13:21     ` Jeff Layton
  1 sibling, 1 reply; 50+ messages in thread
From: Jan Kara @ 2026-01-20  8:40 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Jeff Layton, Christian Brauner, Alexander Viro, Chuck Lever,
	NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Amir Goldstein, Hugh Dickins, Baolin Wang, Andrew Morton,
	Theodore Ts'o, Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu,
	Yue Hu, Jeffle Xu, Sandeep Dhavale, Hongbo Li, Chunhai Guo,
	Carlos Maiolino, Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko,
	Chris Mason, David Sterba, Luis de Bethencourt, Salah Triki,
	Phillip Lougher, Steve French, Paulo Alcantara, Ronnie Sahlberg,
	Shyam Prasad N, Bharath SM, Miklos Szeredi, Mike Marshall,
	Martin Brandenburg, Mark Fasheh, Joel Becker, Joseph Qi,
	Konstantin Komarov, Ryusuke Konishi, Trond Myklebust,
	Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, linux-nfs, linux-kernel, linux-fsdevel, linux-mm,
	linux-ext4, linux-erofs, linux-xfs, ceph-devel, linux-btrfs,
	linux-cifs, samba-technical, linux-unionfs, devel, ocfs2-devel,
	ntfs3, linux-nilfs, jfs-discussion, linux-mtd, gfs2,
	linux-f2fs-devel, linux-doc

On Mon 19-01-26 23:50:13, Christoph Hellwig wrote:
> On Mon, Jan 19, 2026 at 11:26:19AM -0500, Jeff Layton wrote:
> > +  EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
> > +    stable across the lifetime of a file. This is a hard requirement for export
> > +    via nfsd. Any filesystem that is eligible to be exported via nfsd must
> > +    indicate this guarantee by setting this flag. Most disk-based filesystems
> > +    can do this naturally. Pseudofilesystems that are for local reporting and
> > +    control (e.g. kernfs, pidfs, nsfs) usually can't support this.
> 
> Suggested rewording, taking some of the ideas from Dave Chinners earlier
> comments into account:
> 
>   EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
>     stable across the lifetime of a file.  A file in this context is an
>     instantiated inode reachable by one or more file names, or still open after
>     the last name has been unlinked.  Reuses of the same on-disk inode structure
>     are considered new files and must provide different file handles from the
>     previous incarnation.  Most file systems designed to store user data
>     naturally provide this capability.  Pseudofilesystems that are for local
>     reporting and control (e.g. kernfs, pidfs, nsfs) usually can't support this.
> 
>     This flags is a hard requirement for export via nfsd. Any filesystem that
>     is eligible to be exported via nfsd must indicate this guarantee by
>     setting this flag.

I like this. It certainly makes the requirement of stability clearer to me
(with explanations before I couldn't quite see the difference between shmem
and kernfs). I'd note that fat or shmem (which are both exportable)
satisfy this only with reasonably high probability as they use
get_random_u32() for initializing their i_generation but I guess it's as
good as it gets for them.

								Honza
-- 
Jan Kara <jack@suse.com>
SUSE Labs, CR


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-20  7:44   ` Christoph Hellwig
@ 2026-01-20 13:20     ` Jeff Layton
  2026-01-20 14:12       ` Jeff Layton
  0 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-20 13:20 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet, David Laight, Dave Chinner, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Mon, 2026-01-19 at 23:44 -0800, Christoph Hellwig wrote:
> On Mon, Jan 19, 2026 at 11:26:18AM -0500, Jeff Layton wrote:
> > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
> > +    filesystems cannot properly support file locking as implemented by
> > +    nfsd. A case in point is reexport of NFS itself, which can't be done
> > +    safely without coordinating the grace period handling. Other clustered
> > +    and networked filesystems can be problematic here as well.
> 
> I'm not sure this is very useful.  It really needs to document what
> locking semantics nfs expects, because otherwise no reader will know
> if they set this or not.

Fair point. I'll see if I can draft something better. Suggestions
welcome.
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag
  2026-01-20  7:50   ` Christoph Hellwig
  2026-01-20  8:40     ` Jan Kara
@ 2026-01-20 13:21     ` Jeff Layton
  1 sibling, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-20 13:21 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet, David Laight, Dave Chinner, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Mon, 2026-01-19 at 23:50 -0800, Christoph Hellwig wrote:
> On Mon, Jan 19, 2026 at 11:26:19AM -0500, Jeff Layton wrote:
> > +  EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
> > +    stable across the lifetime of a file. This is a hard requirement for export
> > +    via nfsd. Any filesystem that is eligible to be exported via nfsd must
> > +    indicate this guarantee by setting this flag. Most disk-based filesystems
> > +    can do this naturally. Pseudofilesystems that are for local reporting and
> > +    control (e.g. kernfs, pidfs, nsfs) usually can't support this.
> 
> Suggested rewording, taking some of the ideas from Dave Chinners earlier
> comments into account:
> 
>   EXPORT_OP_STABLE_HANDLES - This filesystem provides filehandles that are
>     stable across the lifetime of a file.  A file in this context is an
>     instantiated inode reachable by one or more file names, or still open after
>     the last name has been unlinked.  Reuses of the same on-disk inode structure
>     are considered new files and must provide different file handles from the
>     previous incarnation.  Most file systems designed to store user data
>     naturally provide this capability.  Pseudofilesystems that are for local
>     reporting and control (e.g. kernfs, pidfs, nsfs) usually can't support this.
> 
>     This flags is a hard requirement for export via nfsd. Any filesystem that
>     is eligible to be exported via nfsd must indicate this guarantee by
>     setting this flag.

Thanks Christoph! I'll plan to adopt this for v3.
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints
  2026-01-19 16:47   ` Chuck Lever
@ 2026-01-20 13:42     ` Jeff Layton
  0 siblings, 0 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-20 13:42 UTC (permalink / raw)
  To: Chuck Lever, Christian Brauner, Alexander Viro, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet
  Cc: David Laight, Dave Chinner, Christoph Hellwig, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Mon, 2026-01-19 at 11:47 -0500, Chuck Lever wrote:
> On 1/19/26 11:26 AM, Jeff Layton wrote:
> > Get rid of the dprintk messages in check_export(). Instead add new
> > tracepoints that show the terminal inode and the flags.
> > 
> > Signed-off-by: Jeff Layton <jlayton@kernel.org>
> > ---
> >  fs/nfsd/export.c | 11 ++++++-----
> >  fs/nfsd/trace.h  | 52 ++++++++++++++++++++++++++++++++++++++++++++++++++++
> >  2 files changed, 58 insertions(+), 5 deletions(-)
> > 
> > diff --git a/fs/nfsd/export.c b/fs/nfsd/export.c
> > index bc703cf58bfa210c7c57d49f22f15bc10d7cfc91..3cc336b953b38573966c43000f31cd341380837b 100644
> > --- a/fs/nfsd/export.c
> > +++ b/fs/nfsd/export.c
> > @@ -435,31 +435,32 @@ static int check_export(const struct path *path, int *flags, unsigned char *uuid
> >  	if (!(inode->i_sb->s_type->fs_flags & FS_REQUIRES_DEV) &&
> >  	    !(*flags & NFSEXP_FSID) &&
> >  	    uuid == NULL) {
> > -		dprintk("exp_export: export of non-dev fs without fsid\n");
> > +		trace_nfsd_check_export_need_fsid(inode, *flags);
> >  		return -EINVAL;
> >  	}
> >  
> >  	if (!exportfs_can_decode_fh(inode->i_sb->s_export_op)) {
> > -		dprintk("exp_export: export of invalid fs type.\n");
> > +		trace_nfsd_check_export_invalid_fstype(inode, *flags);
> >  		return -EINVAL;
> >  	}
> >  
> >  	if (!(inode->i_sb->s_export_op->flags & EXPORT_OP_STABLE_HANDLES)) {
> > -		dprintk("%s: fs does not provide stable filehandles!\n", __func__);
> > +		trace_nfsd_check_export_no_stable_fh(inode, *flags);
> >  		return -EINVAL;
> >  	}
> >  
> >  	if (is_idmapped_mnt(path->mnt)) {
> >  		dprintk("exp_export: export of idmapped mounts not yet supported.\n");

Doh! I left the above dprintk() in -- fixed in tree.

> > +		trace_nfsd_check_export_idmapped(inode, *flags);
> >  		return -EINVAL;
> >  	}
> >  
> >  	if (inode->i_sb->s_export_op->flags & EXPORT_OP_NOSUBTREECHK &&
> >  	    !(*flags & NFSEXP_NOSUBTREECHECK)) {
> > -		dprintk("%s: %s does not support subtree checking!\n",
> > -			__func__, inode->i_sb->s_type->name);
> > +		trace_nfsd_check_export_subtree(inode, *flags);
> >  		return -EINVAL;
> >  	}
> > +	trace_nfsd_check_export_success(inode, *flags);
> >  	return 0;
> >  }
> >  
> > diff --git a/fs/nfsd/trace.h b/fs/nfsd/trace.h
> > index 5ae2a611e57f4b4e51a4d9eb6e0fccb66ad8d288..e3f5fe1181b605b34cb70d53f32739c3ef9b82f6 100644
> > --- a/fs/nfsd/trace.h
> > +++ b/fs/nfsd/trace.h
> > @@ -339,6 +339,58 @@ DEFINE_EVENT_CONDITION(nfsd_fh_err_class, nfsd_##name,	\
> >  DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badexport);
> >  DEFINE_NFSD_FH_ERR_EVENT(set_fh_dentry_badhandle);
> >  
> > +#define show_export_flags(val)						\
> 
> Whacky. I thought we had one of these already, but I can't find one.
> 
> 
> > +	__print_flags(val, "|",						\
> > +		{ NFSEXP_READONLY,		"READONLY" },		\
> > +		{ NFSEXP_INSECURE_PORT,		"INSECURE" },		\
> > +		{ NFSEXP_ROOTSQUASH,		"ROOTSQUASH" },		\
> > +		{ NFSEXP_ALLSQUASH,		"ALLSQUASH" },		\
> > +		{ NFSEXP_ASYNC,			"ASYNC" },		\
> > +		{ NFSEXP_GATHERED_WRITES,	"GATHERED_WRITES" },	\
> > +		{ NFSEXP_NOREADDIRPLUS,		"NOREADDIRPLUS" },	\
> > +		{ NFSEXP_SECURITY_LABEL,	"SECURITY_LABEL" },	\
> > +		{ NFSEXP_NOHIDE,		"NOHIDE" },		\
> > +		{ NFSEXP_NOSUBTREECHECK,	"NOSUBTREECHECK" },	\
> > +		{ NFSEXP_NOAUTHNLM,		"NOAUTHNLM" },		\
> > +		{ NFSEXP_MSNFS,			"MSNFS" },		\
> > +		{ NFSEXP_FSID,			"FSID" },		\
> > +		{ NFSEXP_CROSSMOUNT,		"CROSSMOUNT" },		\
> > +		{ NFSEXP_NOACL,			"NOACL" },		\
> > +		{ NFSEXP_V4ROOT,		"V4ROOT" },		\
> > +		{ NFSEXP_PNFS,			"PNFS" })
> > +
> > +DECLARE_EVENT_CLASS(nfsd_check_export_class,
> > +	TP_PROTO(const struct inode *inode,
> > +		 int flags),
> > +	TP_ARGS(inode, flags),
> > +	TP_STRUCT__entry(
> > +		__field(dev_t, dev)
> > +		__field(ino_t, ino)
> > +		__field(int, flags)
> > +	),
> > +	TP_fast_assign(
> > +		__entry->dev = inode->i_sb->s_dev;
> > +		__entry->ino = inode->i_ino;
> > +		__entry->flags = flags;
> > +	),
> > +	TP_printk("dev=%u:%u:%lu flags=%s",
> > +		  MAJOR(__entry->dev), MINOR(__entry->dev),
> > +		  __entry->ino, show_export_flags(__entry->flags))
> > +)
> > +
> > +#define DEFINE_NFSD_CHECK_EXPORT_EVENT(name)			\
> > +DEFINE_EVENT(nfsd_check_export_class, nfsd_check_export_##name,	\
> > +	TP_PROTO(const struct inode *inode,			\
> > +		 int flags),					\
> > +	TP_ARGS(inode, flags))
> > +
> > +DEFINE_NFSD_CHECK_EXPORT_EVENT(need_fsid);
> > +DEFINE_NFSD_CHECK_EXPORT_EVENT(invalid_fstype);
> > +DEFINE_NFSD_CHECK_EXPORT_EVENT(no_stable_fh);
> > +DEFINE_NFSD_CHECK_EXPORT_EVENT(idmapped);
> > +DEFINE_NFSD_CHECK_EXPORT_EVENT(subtree);
> > +DEFINE_NFSD_CHECK_EXPORT_EVENT(success);
> > +
> >  TRACE_EVENT(nfsd_exp_find_key,
> >  	TP_PROTO(const struct svc_expkey *key,
> >  		 int status),
> > 
> 
> 'Twould be nice to report the namespace or client address that
> was making the failing request, but maybe that information is
> not available in check_export.
>
> Reviewed-by: Chuck Lever <chuck.lever@oracle.com>
> 

That might be possible, but it means refactoring check_export().

Given that we're still haggling over the flag name and semantics, lets
drop this patch from the series for now.

Once the other bits are settled, I'll respin the tracepoint patches on
top. That part can be better sorted out on the linux-nfs ml anyway.

Thanks!
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-20 13:20     ` Jeff Layton
@ 2026-01-20 14:12       ` Jeff Layton
  2026-01-20 14:35         ` Jeff Layton
  0 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-20 14:12 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet, David Laight, Dave Chinner, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Tue, 2026-01-20 at 08:20 -0500, Jeff Layton wrote:
> On Mon, 2026-01-19 at 23:44 -0800, Christoph Hellwig wrote:
> > On Mon, Jan 19, 2026 at 11:26:18AM -0500, Jeff Layton wrote:
> > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
> > > +    filesystems cannot properly support file locking as implemented by
> > > +    nfsd. A case in point is reexport of NFS itself, which can't be done
> > > +    safely without coordinating the grace period handling. Other clustered
> > > +    and networked filesystems can be problematic here as well.
> > 
> > I'm not sure this is very useful.  It really needs to document what
> > locking semantics nfs expects, because otherwise no reader will know
> > if they set this or not.
> 
> Fair point. I'll see if I can draft something better. Suggestions
> welcome.

How about this?

+  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
+    that want to support locking over NFS must support POSIX file locking
+    semantics and must handle lock recovery requests from clients after a
+    reboot. Most local disk, RAM, or pseudo-filesystems use the generic POSIX
+    locking support in the kernel and naturally provide this capability. Network
+    or clustered filesystems usually need special handling to do this properly.

-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-20 14:12       ` Jeff Layton
@ 2026-01-20 14:35         ` Jeff Layton
  2026-01-21  9:17           ` Christoph Hellwig
  2026-01-21  9:58           ` NeilBrown
  0 siblings, 2 replies; 50+ messages in thread
From: Jeff Layton @ 2026-01-20 14:35 UTC (permalink / raw)
  To: Christoph Hellwig
  Cc: Christian Brauner, Alexander Viro, Chuck Lever, NeilBrown,
	Olga Kornievskaia, Dai Ngo, Tom Talpey, Amir Goldstein,
	Hugh Dickins, Baolin Wang, Andrew Morton, Theodore Ts'o,
	Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu,
	Sandeep Dhavale, Hongbo Li, Chunhai Guo, Carlos Maiolino,
	Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko, Chris Mason,
	David Sterba, Luis de Bethencourt, Salah Triki, Phillip Lougher,
	Steve French, Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N,
	Bharath SM, Miklos Szeredi, Mike Marshall, Martin Brandenburg,
	Mark Fasheh, Joel Becker, Joseph Qi, Konstantin Komarov,
	Ryusuke Konishi, Trond Myklebust, Anna Schumaker, Dave Kleikamp,
	David Woodhouse, Richard Weinberger, Jan Kara,
	Andreas Gruenbacher, OGAWA Hirofumi, Jaegeuk Kim,
	Jonathan Corbet, David Laight, Dave Chinner, linux-nfs,
	linux-kernel, linux-fsdevel, linux-mm, linux-ext4, linux-erofs,
	linux-xfs, ceph-devel, linux-btrfs, linux-cifs, samba-technical,
	linux-unionfs, devel, ocfs2-devel, ntfs3, linux-nilfs,
	jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel, linux-doc

On Tue, 2026-01-20 at 09:12 -0500, Jeff Layton wrote:
> On Tue, 2026-01-20 at 08:20 -0500, Jeff Layton wrote:
> > On Mon, 2026-01-19 at 23:44 -0800, Christoph Hellwig wrote:
> > > On Mon, Jan 19, 2026 at 11:26:18AM -0500, Jeff Layton wrote:
> > > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
> > > > +    filesystems cannot properly support file locking as implemented by
> > > > +    nfsd. A case in point is reexport of NFS itself, which can't be done
> > > > +    safely without coordinating the grace period handling. Other clustered
> > > > +    and networked filesystems can be problematic here as well.
> > > 
> > > I'm not sure this is very useful.  It really needs to document what
> > > locking semantics nfs expects, because otherwise no reader will know
> > > if they set this or not.
> > 
> > Fair point. I'll see if I can draft something better. Suggestions
> > welcome.
> 
> How about this?
> 
> +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
> +    that want to support locking over NFS must support POSIX file locking
> +    semantics and must handle lock recovery requests from clients after a
> +    reboot. Most local disk, RAM, or pseudo-filesystems use the generic POSIX
> +    locking support in the kernel and naturally provide this capability. Network
> +    or clustered filesystems usually need special handling to do this properly.

Even better, I think?

+
+  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
+    that want to support locking over NFS must support POSIX file locking
+    semantics. When the server reboots, the clients will issue requests to
+    recover their locks, which nfsd will issue to the filesystem as new lock
+    requests. Those must succeed in order for lock recovery to work. Most
+    local disk, RAM, or pseudo-filesystems use the generic POSIX locking
+    support in the kernel and naturally provide this capability. Network or
+    clustered filesystems usually need special handling to do this properly.
+    Set this flag on filesystems that can't guarantee the proper semantics
+    (e.g. reexported NFS).

-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag
  2026-01-20  8:40     ` Jan Kara
@ 2026-01-21  9:17       ` Christoph Hellwig
  0 siblings, 0 replies; 50+ messages in thread
From: Christoph Hellwig @ 2026-01-21  9:17 UTC (permalink / raw)
  To: Jan Kara
  Cc: Christoph Hellwig, Jeff Layton, Christian Brauner,
	Alexander Viro, Chuck Lever, NeilBrown, Olga Kornievskaia,
	Dai Ngo, Tom Talpey, Amir Goldstein, Hugh Dickins, Baolin Wang,
	Andrew Morton, Theodore Ts'o, Andreas Dilger, Jan Kara,
	Gao Xiang, Chao Yu, Yue Hu, Jeffle Xu, Sandeep Dhavale,
	Hongbo Li, Chunhai Guo, Carlos Maiolino, Ilya Dryomov,
	Alex Markuze, Viacheslav Dubeyko, Chris Mason, David Sterba,
	Luis de Bethencourt, Salah Triki, Phillip Lougher, Steve French,
	Paulo Alcantara, Ronnie Sahlberg, Shyam Prasad N, Bharath SM,
	Miklos Szeredi, Mike Marshall, Martin Brandenburg, Mark Fasheh,
	Joel Becker, Joseph Qi, Konstantin Komarov, Ryusuke Konishi,
	Trond Myklebust, Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Andreas Gruenbacher, OGAWA Hirofumi,
	Jaegeuk Kim, Jonathan Corbet, David Laight, Dave Chinner,
	linux-nfs, linux-kernel, linux-fsdevel, linux-mm, linux-ext4,
	linux-erofs, linux-xfs, ceph-devel, linux-btrfs, linux-cifs,
	samba-technical, linux-unionfs, devel, ocfs2-devel, ntfs3,
	linux-nilfs, jfs-discussion, linux-mtd, gfs2, linux-f2fs-devel,
	linux-doc, steve

On Tue, Jan 20, 2026 at 09:40:07AM +0100, Jan Kara wrote:
> (with explanations before I couldn't quite see the difference between shmem
> and kernfs). I'd note that fat or shmem (which are both exportable)
> satisfy this only with reasonably high probability as they use
> get_random_u32() for initializing their i_generation but I guess it's as
> good as it gets for them.

For tmpfs random generations are as good as it gets, in fact that's what
XFS starts with when allocating new inode clusters (which could have
previous been used for for inodes as well).

fat on the other hand looks broken, as it also set a new generation when
reading inodes from disk.  So I don't think fat should be nfs exportable,
even if the export ops predate other uses.



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-20 14:35         ` Jeff Layton
@ 2026-01-21  9:17           ` Christoph Hellwig
  2026-01-21  9:58           ` NeilBrown
  1 sibling, 0 replies; 50+ messages in thread
From: Christoph Hellwig @ 2026-01-21  9:17 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christoph Hellwig, Christian Brauner, Alexander Viro,
	Chuck Lever, NeilBrown, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Amir Goldstein, Hugh Dickins, Baolin Wang, Andrew Morton,
	Theodore Ts'o, Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu,
	Yue Hu, Jeffle Xu, Sandeep Dhavale, Hongbo Li, Chunhai Guo,
	Carlos Maiolino, Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko,
	Chris Mason, David Sterba, Luis de Bethencourt, Salah Triki,
	Phillip Lougher, Steve French, Paulo Alcantara, Ronnie Sahlberg,
	Shyam Prasad N, Bharath SM, Miklos Szeredi, Mike Marshall,
	Martin Brandenburg, Mark Fasheh, Joel Becker, Joseph Qi,
	Konstantin Komarov, Ryusuke Konishi, Trond Myklebust,
	Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, linux-nfs, linux-kernel, linux-fsdevel, linux-mm,
	linux-ext4, linux-erofs, linux-xfs, ceph-devel, linux-btrfs,
	linux-cifs, samba-technical, linux-unionfs, devel, ocfs2-devel,
	ntfs3, linux-nilfs, jfs-discussion, linux-mtd, gfs2,
	linux-f2fs-devel, linux-doc

On Tue, Jan 20, 2026 at 09:35:48AM -0500, Jeff Layton wrote:
> Even better, I think?

This sounds great, thanks!



^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-20 14:35         ` Jeff Layton
  2026-01-21  9:17           ` Christoph Hellwig
@ 2026-01-21  9:58           ` NeilBrown
  2026-01-21 12:29             ` Jeff Layton
  1 sibling, 1 reply; 50+ messages in thread
From: NeilBrown @ 2026-01-21  9:58 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christoph Hellwig, Christian Brauner, Alexander Viro,
	Chuck Lever, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Amir Goldstein, Hugh Dickins, Baolin Wang, Andrew Morton,
	Theodore Ts'o, Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu,
	Yue Hu, Jeffle Xu, Sandeep Dhavale, Hongbo Li, Chunhai Guo,
	Carlos Maiolino, Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko,
	Chris Mason, David Sterba, Luis de Bethencourt, Salah Triki,
	Phillip Lougher, Steve French, Paulo Alcantara, Ronnie Sahlberg,
	Shyam Prasad N, Bharath SM, Miklos Szeredi, Mike Marshall,
	Martin Brandenburg, Mark Fasheh, Joel Becker, Joseph Qi,
	Konstantin Komarov, Ryusuke Konishi, Trond Myklebust,
	Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, linux-nfs, linux-kernel, linux-fsdevel, linux-mm,
	linux-ext4, linux-erofs, linux-xfs, ceph-devel, linux-btrfs,
	linux-cifs, samba-technical, linux-unionfs, devel, ocfs2-devel,
	ntfs3, linux-nilfs, jfs-discussion, linux-mtd, gfs2,
	linux-f2fs-devel, linux-doc

On Wed, 21 Jan 2026, Jeff Layton wrote:
> On Tue, 2026-01-20 at 09:12 -0500, Jeff Layton wrote:
> > On Tue, 2026-01-20 at 08:20 -0500, Jeff Layton wrote:
> > > On Mon, 2026-01-19 at 23:44 -0800, Christoph Hellwig wrote:
> > > > On Mon, Jan 19, 2026 at 11:26:18AM -0500, Jeff Layton wrote:
> > > > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
> > > > > +    filesystems cannot properly support file locking as implemented by
> > > > > +    nfsd. A case in point is reexport of NFS itself, which can't be done
> > > > > +    safely without coordinating the grace period handling. Other clustered
> > > > > +    and networked filesystems can be problematic here as well.
> > > > 
> > > > I'm not sure this is very useful.  It really needs to document what
> > > > locking semantics nfs expects, because otherwise no reader will know
> > > > if they set this or not.
> > > 
> > > Fair point. I'll see if I can draft something better. Suggestions
> > > welcome.
> > 
> > How about this?
> > 
> > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
> > +    that want to support locking over NFS must support POSIX file locking
> > +    semantics and must handle lock recovery requests from clients after a
> > +    reboot. Most local disk, RAM, or pseudo-filesystems use the generic POSIX
> > +    locking support in the kernel and naturally provide this capability. Network
> > +    or clustered filesystems usually need special handling to do this properly.
> 
> Even better, I think?
> 
> +
> +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
> +    that want to support locking over NFS must support POSIX file locking
> +    semantics. When the server reboots, the clients will issue requests to
> +    recover their locks, which nfsd will issue to the filesystem as new lock
> +    requests. Those must succeed in order for lock recovery to work. Most
> +    local disk, RAM, or pseudo-filesystems use the generic POSIX locking
> +    support in the kernel and naturally provide this capability. Network or
> +    clustered filesystems usually need special handling to do this properly.
> +    Set this flag on filesystems that can't guarantee the proper semantics
> +    (e.g. reexported NFS).

I think this is quite thorough, which it good ...  maybe too good :-) It
reminds me that for true NFS compatibility the fs shouldn't allow local
locks (or file opens!) until the grace period has passed.  I don't think
any local filesystems enforce that - it would have to be locks.c that
does I expect.  I doubt there would be much appetite for doing that
though.

Reviewed-by: NeilBrown <neil@brown.name>

Thanks,
NeilBrown


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-21  9:58           ` NeilBrown
@ 2026-01-21 12:29             ` Jeff Layton
  2026-01-21 22:47               ` NeilBrown
  0 siblings, 1 reply; 50+ messages in thread
From: Jeff Layton @ 2026-01-21 12:29 UTC (permalink / raw)
  To: NeilBrown
  Cc: Christoph Hellwig, Christian Brauner, Alexander Viro,
	Chuck Lever, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Amir Goldstein, Hugh Dickins, Baolin Wang, Andrew Morton,
	Theodore Ts'o, Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu,
	Yue Hu, Jeffle Xu, Sandeep Dhavale, Hongbo Li, Chunhai Guo,
	Carlos Maiolino, Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko,
	Chris Mason, David Sterba, Luis de Bethencourt, Salah Triki,
	Phillip Lougher, Steve French, Paulo Alcantara, Ronnie Sahlberg,
	Shyam Prasad N, Bharath SM, Miklos Szeredi, Mike Marshall,
	Martin Brandenburg, Mark Fasheh, Joel Becker, Joseph Qi,
	Konstantin Komarov, Ryusuke Konishi, Trond Myklebust,
	Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, linux-nfs, linux-kernel, linux-fsdevel, linux-mm,
	linux-ext4, linux-erofs, linux-xfs, ceph-devel, linux-btrfs,
	linux-cifs, samba-technical, linux-unionfs, devel, ocfs2-devel,
	ntfs3, linux-nilfs, jfs-discussion, linux-mtd, gfs2,
	linux-f2fs-devel, linux-doc

On Wed, 2026-01-21 at 20:58 +1100, NeilBrown wrote:
> On Wed, 21 Jan 2026, Jeff Layton wrote:
> > On Tue, 2026-01-20 at 09:12 -0500, Jeff Layton wrote:
> > > On Tue, 2026-01-20 at 08:20 -0500, Jeff Layton wrote:
> > > > On Mon, 2026-01-19 at 23:44 -0800, Christoph Hellwig wrote:
> > > > > On Mon, Jan 19, 2026 at 11:26:18AM -0500, Jeff Layton wrote:
> > > > > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
> > > > > > +    filesystems cannot properly support file locking as implemented by
> > > > > > +    nfsd. A case in point is reexport of NFS itself, which can't be done
> > > > > > +    safely without coordinating the grace period handling. Other clustered
> > > > > > +    and networked filesystems can be problematic here as well.
> > > > > 
> > > > > I'm not sure this is very useful.  It really needs to document what
> > > > > locking semantics nfs expects, because otherwise no reader will know
> > > > > if they set this or not.
> > > > 
> > > > Fair point. I'll see if I can draft something better. Suggestions
> > > > welcome.
> > > 
> > > How about this?
> > > 
> > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
> > > +    that want to support locking over NFS must support POSIX file locking
> > > +    semantics and must handle lock recovery requests from clients after a
> > > +    reboot. Most local disk, RAM, or pseudo-filesystems use the generic POSIX
> > > +    locking support in the kernel and naturally provide this capability. Network
> > > +    or clustered filesystems usually need special handling to do this properly.
> > 
> > Even better, I think?
> > 
> > +
> > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
> > +    that want to support locking over NFS must support POSIX file locking
> > +    semantics. When the server reboots, the clients will issue requests to
> > +    recover their locks, which nfsd will issue to the filesystem as new lock
> > +    requests. Those must succeed in order for lock recovery to work. Most
> > +    local disk, RAM, or pseudo-filesystems use the generic POSIX locking
> > +    support in the kernel and naturally provide this capability. Network or
> > +    clustered filesystems usually need special handling to do this properly.
> > +    Set this flag on filesystems that can't guarantee the proper semantics
> > +    (e.g. reexported NFS).
> 
> I think this is quite thorough, which it good ...  maybe too good :-) It
> reminds me that for true NFS compatibility the fs shouldn't allow local
> locks (or file opens!) until the grace period has passed.  I don't think
> any local filesystems enforce that - it would have to be locks.c that
> does I expect.  I doubt there would be much appetite for doing that
> though.
> 

Yeah, I don't see us ever doing that. It'd be a tricky chicken-and-egg
problem, given the demand-driven way that the mountd upcalls work
today. We don't even know that anything is exported until something
asks for it.

> Reviewed-by: NeilBrown <neil@brown.name>
> 

Thanks!
-- 
Jeff Layton <jlayton@kernel.org>


^ permalink raw reply	[flat|nested] 50+ messages in thread

* Re: [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS
  2026-01-21 12:29             ` Jeff Layton
@ 2026-01-21 22:47               ` NeilBrown
  0 siblings, 0 replies; 50+ messages in thread
From: NeilBrown @ 2026-01-21 22:47 UTC (permalink / raw)
  To: Jeff Layton
  Cc: Christoph Hellwig, Christian Brauner, Alexander Viro,
	Chuck Lever, Olga Kornievskaia, Dai Ngo, Tom Talpey,
	Amir Goldstein, Hugh Dickins, Baolin Wang, Andrew Morton,
	Theodore Ts'o, Andreas Dilger, Jan Kara, Gao Xiang, Chao Yu,
	Yue Hu, Jeffle Xu, Sandeep Dhavale, Hongbo Li, Chunhai Guo,
	Carlos Maiolino, Ilya Dryomov, Alex Markuze, Viacheslav Dubeyko,
	Chris Mason, David Sterba, Luis de Bethencourt, Salah Triki,
	Phillip Lougher, Steve French, Paulo Alcantara, Ronnie Sahlberg,
	Shyam Prasad N, Bharath SM, Miklos Szeredi, Mike Marshall,
	Martin Brandenburg, Mark Fasheh, Joel Becker, Joseph Qi,
	Konstantin Komarov, Ryusuke Konishi, Trond Myklebust,
	Anna Schumaker, Dave Kleikamp, David Woodhouse,
	Richard Weinberger, Jan Kara, Andreas Gruenbacher,
	OGAWA Hirofumi, Jaegeuk Kim, Jonathan Corbet, David Laight,
	Dave Chinner, linux-nfs, linux-kernel, linux-fsdevel, linux-mm,
	linux-ext4, linux-erofs, linux-xfs, ceph-devel, linux-btrfs,
	linux-cifs, samba-technical, linux-unionfs, devel, ocfs2-devel,
	ntfs3, linux-nilfs, jfs-discussion, linux-mtd, gfs2,
	linux-f2fs-devel, linux-doc

On Wed, 21 Jan 2026, Jeff Layton wrote:
> On Wed, 2026-01-21 at 20:58 +1100, NeilBrown wrote:
> > On Wed, 21 Jan 2026, Jeff Layton wrote:
> > > On Tue, 2026-01-20 at 09:12 -0500, Jeff Layton wrote:
> > > > On Tue, 2026-01-20 at 08:20 -0500, Jeff Layton wrote:
> > > > > On Mon, 2026-01-19 at 23:44 -0800, Christoph Hellwig wrote:
> > > > > > On Mon, Jan 19, 2026 at 11:26:18AM -0500, Jeff Layton wrote:
> > > > > > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Some
> > > > > > > +    filesystems cannot properly support file locking as implemented by
> > > > > > > +    nfsd. A case in point is reexport of NFS itself, which can't be done
> > > > > > > +    safely without coordinating the grace period handling. Other clustered
> > > > > > > +    and networked filesystems can be problematic here as well.
> > > > > > 
> > > > > > I'm not sure this is very useful.  It really needs to document what
> > > > > > locking semantics nfs expects, because otherwise no reader will know
> > > > > > if they set this or not.
> > > > > 
> > > > > Fair point. I'll see if I can draft something better. Suggestions
> > > > > welcome.
> > > > 
> > > > How about this?
> > > > 
> > > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
> > > > +    that want to support locking over NFS must support POSIX file locking
> > > > +    semantics and must handle lock recovery requests from clients after a
> > > > +    reboot. Most local disk, RAM, or pseudo-filesystems use the generic POSIX
> > > > +    locking support in the kernel and naturally provide this capability. Network
> > > > +    or clustered filesystems usually need special handling to do this properly.
> > > 
> > > Even better, I think?
> > > 
> > > +
> > > +  EXPORT_OP_NOLOCKS - Disable file locking on this filesystem. Filesystems
> > > +    that want to support locking over NFS must support POSIX file locking
> > > +    semantics. When the server reboots, the clients will issue requests to
> > > +    recover their locks, which nfsd will issue to the filesystem as new lock
> > > +    requests. Those must succeed in order for lock recovery to work. Most
> > > +    local disk, RAM, or pseudo-filesystems use the generic POSIX locking
> > > +    support in the kernel and naturally provide this capability. Network or
> > > +    clustered filesystems usually need special handling to do this properly.
> > > +    Set this flag on filesystems that can't guarantee the proper semantics
> > > +    (e.g. reexported NFS).
> > 
> > I think this is quite thorough, which it good ...  maybe too good :-) It
> > reminds me that for true NFS compatibility the fs shouldn't allow local
> > locks (or file opens!) until the grace period has passed.  I don't think
> > any local filesystems enforce that - it would have to be locks.c that
> > does I expect.  I doubt there would be much appetite for doing that
> > though.
> > 
> 
> Yeah, I don't see us ever doing that. It'd be a tricky chicken-and-egg
> problem, given the demand-driven way that the mountd upcalls work
> today. We don't even know that anything is exported until something
> asks for it.

statd keeps state in /var/lib/nfs/sm, and nfsd keeps v4 state elsewhere
in /var/lib/nfs.  This state effectively records if any NFS client might
try to recover a lock.
I think the v4 state is granular enough to identify the filesystem.
lockd could be enhanced to use the same state I suspect.

We would need to generalise that state and load it at mount time and
block new state creation accordingly.

i.e. this would have to be a vfs-level thing which nfsd makes use of.

Possibly, but there are other things better worth our time.

NeilBrown



^ permalink raw reply	[flat|nested] 50+ messages in thread

end of thread, other threads:[~2026-01-21 22:48 UTC | newest]

Thread overview: 50+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-19 16:26 [PATCH v2 00/31] fs: require filesystems to explicitly opt-in to nfsd export support Jeff Layton
2026-01-19 16:26 ` [PATCH v2 01/31] Documentation: document EXPORT_OP_NOLOCKS Jeff Layton
2026-01-20  7:44   ` Christoph Hellwig
2026-01-20 13:20     ` Jeff Layton
2026-01-20 14:12       ` Jeff Layton
2026-01-20 14:35         ` Jeff Layton
2026-01-21  9:17           ` Christoph Hellwig
2026-01-21  9:58           ` NeilBrown
2026-01-21 12:29             ` Jeff Layton
2026-01-21 22:47               ` NeilBrown
2026-01-19 16:26 ` [PATCH v2 02/31] exportfs: add new EXPORT_OP_STABLE_HANDLES flag Jeff Layton
2026-01-19 16:41   ` Amir Goldstein
2026-01-20  7:50   ` Christoph Hellwig
2026-01-20  8:40     ` Jan Kara
2026-01-21  9:17       ` Christoph Hellwig
2026-01-20 13:21     ` Jeff Layton
2026-01-19 16:26 ` [PATCH v2 03/31] tmpfs: add EXPORT_OP_STABLE_HANDLES flag to export operations Jeff Layton
2026-01-19 16:26 ` [PATCH v2 04/31] ext4: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 05/31] ext2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 06/31] erofs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 07/31] efs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 08/31] xfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 09/31] ceph: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 10/31] btrfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 11/31] befs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 12/31] ufs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 13/31] udf: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 14/31] affs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 15/31] squashfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 16/31] smb/client: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 17/31] ovl: " Jeff Layton
2026-01-19 16:42   ` Amir Goldstein
2026-01-19 16:26 ` [PATCH v2 18/31] orangefs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 19/31] ocfs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 20/31] ntfs3: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 21/31] nilfs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 22/31] nfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 23/31] jfs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 24/31] jffs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 25/31] isofs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 26/31] gfs2: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 27/31] fuse: " Jeff Layton
2026-01-19 16:43   ` Amir Goldstein
2026-01-19 16:26 ` [PATCH v2 28/31] fat: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 29/31] f2fs: " Jeff Layton
2026-01-19 16:26 ` [PATCH v2 30/31] nfsd: only allow filesystems that set EXPORT_OP_STABLE_HANDLES Jeff Layton
2026-01-19 16:51   ` Chuck Lever
2026-01-19 16:26 ` [PATCH v2 31/31] nfsd: convert dprintks in check_export() to tracepoints Jeff Layton
2026-01-19 16:47   ` Chuck Lever
2026-01-20 13:42     ` Jeff Layton

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox