Re: sys/ffs: reclaim vnode before dropping last ref

"Theo de Raadt" <[email protected]>
Newsgroups gmane.os.openbsd.tech
Message-ID <[email protected]>
> Right now it works also because vnode is cached inside free list and until
> someone reused it, it is fine.

I should explain what's going on behind the scenes.

A free vnode remains mapped in memory.  It gets added to a freelist, but
you cannot bzero it, because it is not entirely dead becuase the
lifecycle of various pointers and chains are handled very strangely.
Some of this is desiged in (example VALIASED), other things are
accidental sloppiness.

Leaving objects with fields partly live but free, and re-allocated some
various future allocations with different use patterns is not the normal
way to assure high quality code.  It is crazy.

There is an experimental diff which actually unmaps the vnodes so we can see
how far these contract violations have gone.  We could have various use-after-free
bugs today which don't occur in practice, but if we unlock and run things in
parallel things will go badly.

This vrele/vgone error is safe if we want to keep everything biglock.....
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.