close_cached_dir_locked(9)
π close_cached_dir_locked(9)
okay so real talk, bestie β this is a page from the Kernel API Manual, section 9, and we're about to make friends with a very specific little function. it's not the main character of the file, but it is the main character of this page. periodt. π
β¨ NAME β¨
close_cached_dir_locked β put a reference of a cached dir with cfid_list_lock held π¦
πΈ SYNOPSIS πΈ
void close_cached_dir_locked (struct cached_fid *cfid );
π ARGUMENTS π
cfidβ the cached dir. yeah. that's the whole argument. she's the dir, she's cached, she's the one we're putting a reference on. iconic behavior honestly π«Ά
π₯ DESCRIPTION π₯
okay so here's the tea β β if you call close_cached_dir while holding cfid_list_lock, there's a potential effect of causing a deadlock, and that only happens if the invariant refcount >= 2 is false. so likeβ¦ not always, but the risk is right there and we're not about to pretend it isn't. π
this function exists for paths that hold cfid_list_lock and expect at least two references. that's the whole vibe check: two refs minimum, no exceptions. if that invariant is violated, it WARNs and returns without dropping a reference β not a single one, nope, she's not doing that π«
β οΈ so if you're in that violated-invariant situation, you're not done. the final put must still go through close_cached_dir. don't skip it, don't forget it, don't "it's probably fine" it. it's not fine. go do the final put. π
π SEE ALSO π
- Kernel file
./fs/smb/client/cached_dir.c close_cached_dir(9)β the other one, the one you actually finish with π
and that's the whole page, bestie! π this absolute gem lives in ./fs/smb/client and it's dated October 2026, page close_cached_dir_locked(9) in the Kernel API Manual. lowkey obsessed with how short and specific she is. slay, go drop that reference properly β¨ππ¦
π¦ 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