O_DIRECTORY|O_TMPFILE
O_DIRECTORY|O_TMPFILE
Posted Aug 2, 2026 5:37 UTC (Sun) by donald.buczek (subscriber, #112892)In reply to: O_DIRECTORY|O_TMPFILE by koverstreet
Parent article: Reconsidering O_CREAT|O_DIRECTORY
It'd create others, though: unlinked files are a problem for observability; if you forget to kill something, or a program is doing something unexpected, it makes "where'd my disk space go" into a real game.
Yes, but we already have that with unlinked regular files.
So, as the bcachefs maintainer: I'd be happy to take patches or implement O_DIRECTORY|O_TMPFILE in bcachefs - after we have a solution to that one.
Would anyone other than you be able to do that? There is no point even asking my employer to release me from work for the last few years leading up to retirement. :-)
You'd need the VFS to track when the tree has gone away, and the dcache would have to be able to operate on disconnected subtrees.
So I think an implementation for tmpfs, which already has its own independent value, would indeed be a good first target and an implementation on a persistent filesystem might come after that.
