[RFC PATCH v2 01/11] exportfs: add ability to advertise NFSv4 ACL passthru support

Mike Snitzer
2026-02-24T19:24:41Z

Add EXPORT_OP_NFSV4_ACL_PASSTHRU flag that an export should set if
relevant new methods are added to export_operations (e.g. .setacl and
.getacl which will be added in future commits).

NFSD will use exportfs_may_passthru_nfs4acl() to check for this flag
before passing nfs4_acl thru to exported FS (using new methods in
export_operations).

Signed-off-by: Mike Snitzer <snitzer@hammerspace.com>
---
include/linux/exportfs.h | 13 +++++++++++++
1 file changed, 13 insertions(+)

diff --git a/include/linux/exportfs.h b/include/linux/exportfs.h
index 8bcdba28b406..7823c9693346 100644
--- a/include/linux/exportfs.h
+++ b/include/linux/exportfs.h
@@ -307,6 +307,7 @@ struct export_operations {
*/
#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_NFSV4_ACL_PASSTHRU (0x80) /* fs MAY handle NFSv4 ACL passthru */
unsigned long flags;
};

@@ -322,6 +323,18 @@ exportfs_cannot_lock(const struct export_operations *export_ops)
return export_ops->flags & EXPORT_OP_NOLOCKS;
}

+/**
+ * exportfs_may_passthru_nfs4acl() - check if export MAY passthru NFSv4 ACLs
+ * @export_ops: the nfs export operations to check
+ *
+ * Returns true if the export MAY support NFSv4 ACL passthru.
+ */
+static inline bool
+exportfs_may_passthru_nfs4acl(const struct export_operations *export_ops)
+{
+ return export_ops->flags & EXPORT_OP_NFSV4_ACL_PASSTHRU;
+}
+
extern int exportfs_encode_inode_fh(struct inode *inode, struct fid *fid,
int *max_len, struct inode *parent,
int flags);
--
2.44.0