posix_acl_from_xattr(9)
π posix_acl_from_xattr β the Kernel API Manual, bestie edition β¨
okay so this is posix_acl_from_xattr(9) from the Kernel API Manual and it is literally the glow-up station for POSIX ACLs. it takes them from backing-store format and turns them into VFS format. no cap, it's giving translator-at-the-border energy πβ¨
πΈ NAME πΈ
posix_acl_from_xattr β convert POSIX ACLs from backing store to VFS format. that's the whole job. she does one thing and she does it iconically π
π SYNOPSIS π
struct posix_acl * posix_acl_from_xattr (struct user_namespace *userns ,
const void *value , size_t size );
like, look at her. three args, returns a pointer to a struct posix_acl. main character signature fr fr π«Ά
π¦ ARGUMENTS π¦
usernsβ the filesystem's idmapping. yes bestie, this is the whole reason she exists, hold that thought π§valueβ the uapi representation of POSIX ACLs. the raw material, the before-photo πΈsizeβ the size ofvoid. that's what the manpage says, we don't question it, we just nod π
β DESCRIPTION β
so picture this: your filesystem stores POSIX ACLs in the unaltered uapi format. honestly? valid. but the VFS wants struct posix_acl, and those are two different vibes entirely. that's where our girl comes in π₯
if you're a filesystem keeping POSIX ACLs around in unaltered uapi format, you should use posix_acl_from_xattr when you read them from the backing store and convert them into the struct posix_acl VFS format. she's specially designed for this, like specifically intended to be called from the acl inode operation. not a general-purpose helper, she has a lane and she stays in it π
and here's the cute part: posix_acl_from_xattr will map the raw {g,u}id values stored in ACL_{GROUP,USER} entries into idmapping in userns. so all those raw numeric ids get their little passport stamped and come out speaking the right language π
β οΈ okay important heads-up, no skipping:posix_acl_from_xattrdoes not take idmapped mounts into account. and honestly that's on purpose, let her explain. if it did, then calling it from theget aclinode operation would return POSIX ACLs mapped according to an idmapped mount, which would mean that the value couldn't be cached for the filesystem. caching rights revoked. tragedy. π so instead, idmapped mounts are taken into account on the fly during permission checking, or right at the VFSβuserspace boundary before reporting them to the user. clean, correct, iconic β¨
π RETURN π
what you get back, in order of slay:
- Allocated
struct posix_aclon success β the dream scenario, the moment π NULLfor a valid header but without actual POSIX ACL entries β valid but empty, she's there but she's not there π- or an
ERR_PTRencoded error code β the vibe check failed, check your pointers bestie π
π SEE ALSO π
Kernel file ./fs/posix_acl.c, plus the whole friend group, they all ate:
posix_acl_chmod(9)posix_acl_update_mode(9)vfs_posix_acl_to_xattr(9)vfs_set_acl(9)vfs_get_acl(9)vfs_remove_acl(9)
π«Ά that's the whole page! this one lives out of ./fs, dated October 2026 β big kiss to the kernel docs, mwah π go convert some ACLs, you've got this π
π¦ where this page comes from
- nixpkgs unstable: linux-manual 7.3.1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms