On Mon, 15 Aug 2022, Richard Miller wrote:
A simple fix is to add a reference count to the Ram struct, to
keep track of how many Fids point to it, and only allow a Ram to
be re-used if both busy==0 and ref==0. The new 9legacy patch
ramfs-refcount makes this change.
Thanks for sharing this with
Deleting an open file on ramfs(4) can have surpising results.
Here's how it's supposed to behave. When a file is removed, the
Ram struct which represents the in-memory file has its busy flag
reset, so a subsequent i/o will see that it's been deleted.
cpu% ramfs
cpu% echo this is x >/tmp/x
cpu% {