How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.
How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.
Posted Nov 5, 2025 11:19 UTC (Wed) by paulj (subscriber, #341)Parent article: Namespace reference counting and listns()
Isn't it entirely the expected and long-standing behaviour of filehandles? A user-space programme can acquire a file-handle for something, the object itself can be removed from any indexes that make it visible (e.g., where the file-handle references a file, the programme itself or another can delete the file-name entr{y,ies} from the filesystem), and the programme could if it wishes make the referred to object visible again (adding a file-name in the filesystem again for the file-handle).
This is entirely normal, expected behaviour with file-handles, the referenced object, and whatever generally queryable indices there may be of such objects (e.g. filesystems).
I think, at best, the author means this *normal behaviour* is - for some reason - not desired for namespaces. And the reason why namespaces are special, compared to other objects, should then have been explained.
Posted Nov 5, 2025 13:55 UTC (Wed)
by corbet (editor, #1)
[Link] (2 responses)
Posted Nov 5, 2025 15:26 UTC (Wed)
by paulj (subscriber, #341)
[Link] (1 responses)
Posted Nov 5, 2025 15:46 UTC (Wed)
by corbet (editor, #1)
[Link]
Please, do not confuse file handles with file descriptors. A file handle is best thought of, perhaps, as an alternative name for the file. Just as the possession of a file's name does not cause its persistence, holding a file handle doesn't keep a file around.
How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.
How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.
They are new with regard to namespaces, but file handles are a fairly old concept; I think they had their origin with NFS many years ago.
How is this an API quirk? It's normal and expected behaviour with file-handles in Unix.
