Skip to content

Commit 8093c31

Browse files
rmacklemchucklever
authored andcommitted
NFSD: Add nfsd4_encode_fattr4_acl_trueform_scope
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>
1 parent 4a639a7 commit 8093c31

1 file changed

Lines changed: 10 additions & 0 deletions

File tree

fs/nfsd/nfs4xdr.c

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3484,6 +3484,14 @@ static __be32 nfsd4_encode_fattr4_acl_trueform(struct xdr_stream *xdr,
34843484
return nfs_ok;
34853485
}
34863486

3487+
static __be32 nfsd4_encode_fattr4_acl_trueform_scope(struct xdr_stream *xdr,
3488+
const struct nfsd4_fattr_args *args)
3489+
{
3490+
if (!xdrgen_encode_aclscope4(xdr, ACL_SCOPE_FILE_SYSTEM))
3491+
return nfserr_resource;
3492+
return nfs_ok;
3493+
}
3494+
34873495
#endif /* CONFIG_NFSD_V4_POSIX_ACLS */
34883496

34893497
static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = {
@@ -3596,8 +3604,10 @@ static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = {
35963604

35973605
#ifdef CONFIG_NFSD_V4_POSIX_ACLS
35983606
[FATTR4_ACL_TRUEFORM] = nfsd4_encode_fattr4_acl_trueform,
3607+
[FATTR4_ACL_TRUEFORM_SCOPE] = nfsd4_encode_fattr4_acl_trueform_scope,
35993608
#else
36003609
[FATTR4_ACL_TRUEFORM] = nfsd4_encode_fattr4__noop,
3610+
[FATTR4_ACL_TRUEFORM_SCOPE] = nfsd4_encode_fattr4__noop,
36013611
#endif
36023612
};
36033613

0 commit comments

Comments
 (0)