fsuidgid_has_mapping(9)
π fsuidgid_has_mapping
okay so bestie, this is a page from the Kernel API Manual β section 9, kernel-land, very much main character energy for people who write filesystems β¨. The function is literally called fsuidgid_has_mapping, and yes, that name is a mouthful, but we're gonna get through it together π«Ά.
β¨ NAME β¨
fsuidgid_has_mapping β check whether caller's fsuid/fsgid is mapped π
πΈ SYNOPSIS πΈ
bool fsuidgid_has_mapping (struct super_block *sb , struct mnt_idmap
*idmap );
like, it returns a bool, takes two pointers, that's the whole vibe check π₯
π ARGUMENTS π
sbβ the superblock we want a mapping in, bestie. that's the one.idmapβ the idmap of the relevant mount. the mount's whole identity, honestly π
π¦ DESCRIPTION π¦
okay so here's the tea β: this function checks whether the caller's fsuid and fsgid have a valid mapping in the s_user_ns of the superblock sb. that's it, that's the job π
but wait β there's a little twist, and it's giving conditional logic β¨: if the caller is on an idmapped mount, then map the caller's fsuid and fsgid according to the idmap first. so like, idmap translation happens before the check, not after. periodt π
β RETURN β
trueiffsuidandfsgidis mappedfalseif not
no in-between, no "it depends", just a clean yes or no, we love a decisive icon ππ
π SEE ALSO π
Kernel file ./include/linux/fs.h β and then a whole friend group of related things, ngl this list is long but every single one of them ate π:
enum positive_aop_returns(9)struct address_space(9)struct file_ra_state(9)struct file(9)i_uid_into_vfsuid(9)i_uid_needs_update(9)i_uid_update(9)i_gid_into_vfsgid(9)i_gid_needs_update(9)i_gid_update(9)inode_fsuid_set(9)inode_fsgid_set(9)inode_set_ctime(9)file_write_started(9)file_write_not_started(9)struct renamedata(9)is_mgtime(9)iput_if_not_last(9)is_idmapped_mnt(9)file_start_write(9)file_end_write(9)kiocb_start_write(9)kiocb_end_write(9)name_is_dot_dotdot(9)name_contains_dotdot(9)inode_dio_begin(9)inode_dio_end(9)generic_ci_validate_strict_name(9)
and that's the page, bestie π§π β brought to you from the ./include/linux corner of the kernel, dated October 2026, for fsuidgid_has_mapping(9) in the Kernel API Manual. go forth and check those mappings, ily, bye πβ¨
π¦ 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