file_write_not_started(9)
π file_write_not_started(9) β the Kernel API Manual, bestie edition β¨
Okay so real talk: this is a page from the Kernel API Manual (file_write_not_started(9)), and it's a tiny one but it's got lore. Buckle up π
β¨ NAME β¨
file_write_not_started β the little vibe check that asks "is SB_FREEZE_WRITE not held rn?" π¦
β¨ SYNOPSIS β¨
bool file_write_not_started (const struct file *file );
β¨ ARGUMENTS β¨
fileβ the file we write to π (yes that's the whole argument, she's low maintenance)
β¨ DESCRIPTION β¨
So what does it actually do? It checks whether SB_FREEZE_WRITE is not held. That's it. That's the whole gig π
But listen, there are two caveats and I need you to hear me on these, because they're both about false positives and nobody wants to get caught out π
May be false positive with!CONFIG_LOCKDEP/LOCK_STATE_UNKNOWN. So if you're running withoutCONFIG_LOCKDEP, or the lock state isLOCK_STATE_UNKNOWN, it might come back and lie to you a little. Not her fault, it's the config, okay? π
May be false positive with!S_ISREG, becausefile_start_writehas no effect on!S_ISREG. So non-regular files? The check just doesn't bite. Giving nothing, honestly π
β¨ SEE ALSO β¨
Kernel file ./include/linux/fs.h β and the whole friend group π«Ά
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)fsuidgid_has_mapping(9)inode_set_ctime(9)file_write_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)
That's the whole page, bestie, go forth and check your write-freeze status responsibly πΈ
mwah β this masterpiece came out of the ./include/linux source tree, October 2026 edition, and she ate π
β¨π
π¦ 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