]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
NFSD: Add nfsd4_encode_fattr4_acl_trueform_scope
authorRick Macklem <rmacklem@uoguelph.ca>
Fri, 9 Jan 2026 16:21:34 +0000 (11:21 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 29 Jan 2026 14:48:33 +0000 (09:48 -0500)
The FATTR4_ACL_TRUEFORM_SCOPE attribute indicates the granularity at
which the ACL model can vary: per file object, per file system, or
uniformly across the entire server.

In Linux, the ACL model is determined by the SB_POSIXACL superblock
flag, which applies uniformly to all files within a file system.
Different exported file systems can have different ACL models, but
individual files cannot differ from their containing file system.
ACL_SCOPE_FILE_SYSTEM accurately reflects this behavior.

Signed-off-by: Rick Macklem <rmacklem@uoguelph.ca>
Reviewed-by: Jeff Layton <jlayton@kernel.org>
Signed-off-by: Chuck Lever <chuck.lever@oracle.com>
fs/nfsd/nfs4xdr.c

index 9b47cf17ddde5fb99865d59533468859b314d898..63295cff23ed5c170d5ab3ca25172838ae76765d 100644 (file)
@@ -3484,6 +3484,14 @@ static __be32 nfsd4_encode_fattr4_acl_trueform(struct xdr_stream *xdr,
        return nfs_ok;
 }
 
+static __be32 nfsd4_encode_fattr4_acl_trueform_scope(struct xdr_stream *xdr,
+                                                    const struct nfsd4_fattr_args *args)
+{
+       if (!xdrgen_encode_aclscope4(xdr, ACL_SCOPE_FILE_SYSTEM))
+               return nfserr_resource;
+       return nfs_ok;
+}
+
 #endif /* CONFIG_NFSD_V4_POSIX_ACLS */
 
 static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = {
@@ -3596,8 +3604,10 @@ static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = {
 
 #ifdef CONFIG_NFSD_V4_POSIX_ACLS
        [FATTR4_ACL_TRUEFORM]           = nfsd4_encode_fattr4_acl_trueform,
+       [FATTR4_ACL_TRUEFORM_SCOPE]     = nfsd4_encode_fattr4_acl_trueform_scope,
 #else
        [FATTR4_ACL_TRUEFORM]           = nfsd4_encode_fattr4__noop,
+       [FATTR4_ACL_TRUEFORM_SCOPE]     = nfsd4_encode_fattr4__noop,
 #endif
 };