mode_strip_umask(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

🌸 mode_strip_umask(9) β€” a Kernel API Manual moment 🌸

okay bestie, buckle up, we're in the Kernel API Manual today and this one is genuinely iconic. it's mode_strip_umask, and no cap, it's the little helper that decides where your umask gets stripped. main character energy fr fr πŸ’…


✨ NAME ✨

mode_strip_umask β€” the girl who handles vfs umask stripping, periodt πŸŽ€


πŸ¦‹ SYNOPSIS πŸ¦‹

umode_t mode_strip_umask (const struct inode *dir , umode_t mode );

literally just look at her. two arguments, one umode_t return, zero drama ✨


πŸ“ ARGUMENTS πŸ“

  • dir β€” the parent directory of the new inode. like, where the new baby inode is gonna live 🏠
  • mode β€” the mode of the new inode that's about to be created inside dir. this is the vibe we're working with πŸ’œ

🌈 DESCRIPTION 🌈

okay so here's the tea 🍡 β€” in most filesystems, whether umask stripping happens here or somewhere else depends on one thing: does the filesystem support POSIX ACLs or not?

  • if the filesystem doesn't support POSIX ACLs β†’ the umask stripping is done directly in here. right here. this function. she ate πŸ’…
  • if the filesystem does support POSIX ACLs β†’ the umask stripping gets deferred, postponed, pushed back, until the filesystem calls posix_acl_create. she's a busy girl, she'll get to it later 🫢

and then there's the third group, the ✨special✨ ones. some filesystems (hi, NFSv4 πŸ‘‹) also want to avoid umask stripping by the VFS β€” but they don't support POSIX ACLs. awkward, right? 😭 good news: those filesystems can set SB_I_NOUMASK to get that exact effect without declaring that they support POSIX ACLs. loophole queen behavior, honestly πŸ‘‘


⭐ RETURN ⭐

returns mode β€” that's it, that's the return. short and sweet, ngl 🌸


🧚 SEE ALSO 🧚

go read those too, iykyk πŸ’–


πŸŽ€ little reminder bestie: the POSIX ACL support question is the whole plot here, so don't skip it, fr fr. and SB_I_NOUMASK is the move for the NFSv4 girlies who want VFS to leave their umask alone πŸ™ˆ

and that's the whole page, you're so welcome πŸ’œ this lil masterpiece lives in ./include/linux, dated October 2026, and it's filed under mode_strip_umask(9) β€” go forth and strip those umasks responsibly, bestie πŸ¦‹βœ¨πŸ‘‘

πŸ“¦ where this page comes from