unlink_binfmt_handler(9)
π unlink_binfmt_handler(9) β Kernel API Manual
okay so bestie, welcome to the glow-up of unlink_binfmt_handler(9) β¨ this is a kernel API manual page and honestly? it's giving "short but does the most" π
πΈ NAME πΈ
unlink_binfmt_handler β unhash a binary type handler, that's literally it, that's the whole job π
β¨ SYNOPSIS β¨
void unlink_binfmt_handler (struct binfmt_misc *misc , struct
binfmt_misc_entry *e );
no cap, that's the exact signature, copied character for character because we do not play with kernel prototypes π
π«Ά ARGUMENTS π«Ά
miscβ the handle to yourbinfmt_miscinstance. like, which one. there are several. it needs to know πeβ the binary type handler you're un-hashing. yes, this one. bye bestie π
π DESCRIPTION π
so here's the tea, and it's actually kind of iconic π
Adding and removing entries via bm_{entry,register,status}_write and unlink(2) all happens under the exclusively held inode lock of the root dentry β which is what keeps the list stable for the writers. main character lock energy, honestly π
Meanwhile load_misc_binary walks that list concurrently under SRCU. so the lock isn't holding everybody hostage, it's just doing its little job π¦
And entries_lock? it's only held around the actual unlink, purely to serialize against bm_evict_inode, which unlinks entries during umount without holding the root inode lock. so entries_lock is the tiny bouncer at the door for exactly that one situation π
fr fr, if you're touching this, respect the lock discipline β the description is very specific about which lock is held where and why, and that's not decorative β¨
π§ SEE ALSO π§
Kernel file ./fs/binfmt_misc.c, plus the whole friend group:
struct binfmt_misc_flag(9)search_binfmt_handler(9)get_binfmt_handler(9)binfmt_misc_find_interp(9)entry_attach_interpreter(9)put_binfmt_handler(9)current_binfmt_misc(9)entry_select_interpreter(9)entry_invocation_flags(9)entry_open_interpreter(9)build_interp_argv(9)i_binfmt_misc(9)bm_evict_inode(9)remove_binfmt_handler(9)bm_unlink(9)bm_entry_add_interp(9)
iykyk π₯
aaaand that's the page!! π this masterpiece lives in ./fs and it's dated October 2026 β mwah, slay, periodt π
π¦ 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