file_write_not_started(9)

πŸ“¦ version 7.3.1, in nixpkgs unstable

πŸ’… 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 without CONFIG_LOCKDEP, or the lock state is LOCK_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, because file_start_write has 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 🫢


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