Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

NFSD: Add nfsd4_encode_fattr4_acl_trueform

Mapping between NFSv4 ACLs and POSIX ACLs is semantically imprecise:
a client that sets an NFSv4 ACL and reads it back may see a different
ACL than it wrote. The proposed NFSv4 POSIX ACL extension introduces
the FATTR4_ACL_TRUEFORM attribute, which reports whether a file
object stores its access control permissions using NFSv4 ACLs or
POSIX ACLs.

A client aware of this extension can avoid lossy translation by
requesting and setting ACLs in their native format.

When NFSD is built with CONFIG_NFSD_V4_POSIX_ACLS, report
ACL_MODEL_POSIX_DRAFT for file objects on file systems with the
SB_POSIXACL flag set, and ACL_MODEL_NONE otherwise. Linux file
systems do not store NFSv4 ACLs natively, so ACL_MODEL_NFS4 is never
reported.

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

authored by

Rick Macklem and committed by
Chuck Lever
4a639a72 91dc464f

+26
+26
fs/nfsd/nfs4xdr.c
··· 3470 3470 return nfs_ok; 3471 3471 } 3472 3472 3473 + #ifdef CONFIG_NFSD_V4_POSIX_ACLS 3474 + 3475 + static __be32 nfsd4_encode_fattr4_acl_trueform(struct xdr_stream *xdr, 3476 + const struct nfsd4_fattr_args *args) 3477 + { 3478 + aclmodel4 trueform = ACL_MODEL_NONE; 3479 + 3480 + if (IS_POSIXACL(d_inode(args->dentry))) 3481 + trueform = ACL_MODEL_POSIX_DRAFT; 3482 + if (!xdrgen_encode_aclmodel4(xdr, trueform)) 3483 + return nfserr_resource; 3484 + return nfs_ok; 3485 + } 3486 + 3487 + #endif /* CONFIG_NFSD_V4_POSIX_ACLS */ 3488 + 3473 3489 static const nfsd4_enc_attr nfsd4_enc_fattr4_encode_ops[] = { 3474 3490 [FATTR4_SUPPORTED_ATTRS] = nfsd4_encode_fattr4_supported_attrs, 3475 3491 [FATTR4_TYPE] = nfsd4_encode_fattr4_type, ··· 3589 3573 [FATTR4_TIME_DELEG_ACCESS] = nfsd4_encode_fattr4__inval, 3590 3574 [FATTR4_TIME_DELEG_MODIFY] = nfsd4_encode_fattr4__inval, 3591 3575 [FATTR4_OPEN_ARGUMENTS] = nfsd4_encode_fattr4_open_arguments, 3576 + 3577 + /* Reserved */ 3578 + [87] = nfsd4_encode_fattr4__inval, 3579 + [88] = nfsd4_encode_fattr4__inval, 3580 + 3581 + #ifdef CONFIG_NFSD_V4_POSIX_ACLS 3582 + [FATTR4_ACL_TRUEFORM] = nfsd4_encode_fattr4_acl_trueform, 3583 + #else 3584 + [FATTR4_ACL_TRUEFORM] = nfsd4_encode_fattr4__noop, 3585 + #endif 3592 3586 }; 3593 3587 3594 3588 /*