chown_ok(9)
π chown_ok(9) β Kernel API Manual π
okay bestie, welcome to the Kernel API Manual page for chown_ok(9) β itβs giving permission-checking main character energy, and weβre gonna read it together. π«Ά
β¨ NAME β¨
chown_ok β verify permissions to chown inode π
πΈ SYNOPSIS πΈ
bool chown_ok (struct mnt_idmap *idmap , const struct inode *inode ,
vfsuid_t ia_vfsuid );
π ARGUMENTS π
idmapβ the idmap of the mount the inode was found from. πΊοΈinodeβ the inode weβre checking permissions on. πia_vfsuidβ the uid to chown the inode to. π
π¦ DESCRIPTION π¦
So hereβs the vibe: if the inode has been found through an idmapped mount, you must pass the idmap of the vfsmount through idmap. No skipping that, bestie. Then this function will take care to map the inode according to idmap before checking permissions. β¨
On non-idmapped mounts β or if permission checking is to be performed on the raw inode β simply pass nop_mnt_idmap. Easy. Periodt. π
lowkey important: thatidmappassage is not optional for idmapped mounts, andnop_mnt_idmapis the move for non-idmapped mounts or raw-inode checking. π
π₯ SEE ALSO π₯
Kernel file ./fs/attr.c:
setattr_should_drop_sgid(9)setattr_should_drop_suidgid(9)chgrp_ok(9)setattr_prepare(9)inode_newsize_ok(9)setattr_copy_mgtime(9)setattr_copy(9)notify_change(9)
and thatβs the whole page, bestie β sourced from ./fs, dated October 2026, signing off as chown_ok(9). slay πβ¨
π¦ 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