tech-kern archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: multiple vnodes for same file?



On Mon, Jul 09, 2012 at 05:31:32AM +0000, YAMAMOTO Takashi wrote:
> while an expired TTL means puffs can consult userland, it doesn't
> mean the vnode associated to the cache entry can be stale (reclaimed),
> does it?

Yes, you are right. I fixed that part but found other problems in the
meantime, and I am sill refactoring the code. There are many bugs
hidden in perfuse around reclaim, but they have been hidden for now
since vnodes were reclaimed very late, when the kernel ran out of
vnodes. In order to save memmory, I wrote code to reclaim vnodes a
bit earlier, and this opened a can of worms.

Here is an example on which I stuggle right now:
- lookup a in /
- lookup b in a
- reclaim a
- lookup .. in b
  -> this is a, but I forgot its name. I also have a problem to reference its
     parent.
- lookup a  in /
  -> now I must reconnect b/.. and /a since they are the same node.

That suggests that each time I lookup a node, I must walk all nodes
known to perfused to check that it was not already known with same
inode, but with another name (e.g.: "b" vs ".."). I must also modify
the parent when reconnecting ".." to a named node.

Another approach could be to refrain the kernel from reclaiming vnodes
that still have children. It seems much simplier.

-- 
Emmanuel Dreyfus
manu%netbsd.org@localhost


Home | Main Index | Thread Index | Old Index