]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
NFSD: Add nfsd4_encode_fattr4_posix_access_acl
authorRick Macklem <rmacklem@uoguelph.ca>
Fri, 9 Jan 2026 16:21:36 +0000 (11:21 -0500)
committerChuck Lever <chuck.lever@oracle.com>
Thu, 29 Jan 2026 14:48:33 +0000 (09:48 -0500)
commit97e9a9ec32231d75cc241f63ed6fd4cd210079a0
tree36b885b45ac06c6aaabba6fe61980e2f55b72b80
parent5e62c904e4dcc0e53471edca6347cdbc20fd18f8
NFSD: Add nfsd4_encode_fattr4_posix_access_acl

The POSIX ACL extension to NFSv4 defines FATTR4_POSIX_ACCESS_ACL
for retrieving the access ACL of a file or directory. This patch
adds the XDR encoder for that attribute.

The access ACL is retrieved via get_inode_acl(). If the filesystem
provides no explicit access ACL, one is synthesized from the file
mode via posix_acl_from_mode(). Each entry is encoded as a
posixace4: tag type, permission bits, and principal name (empty
for structural entries, resolved via idmapping for USER/GROUP
entries).

Unlike the default ACL encoder which applies only to directories,
this encoder handles all inode types and ensures an access ACL is
always available through mode-based synthesis when needed.

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