Juergen Hannken-Illjes <hann...@eis.cs.tu-bs.de> wrote: > > > > <...> > > > > > > > > It's not obvious from your commit message what prevents it from > > > > gaining a reference after the lock is dropped. > > > > > > The interlock is taken before the freelist lock is dropped and vnodes > > > on the free lists should never appear on other lists. > > > > Not even the name cache? > > > > (I can't remember off the top of my head, but IIRC there's something > > sneaky about it) > > Name cache does vtryget() then vget(). As the usecount is zero, vtryget() > fails and vget() gets called with the interlock held and needs the > freelist lock to proceed. > > I still don't see a race here.
It would be quite cool to expand the comment in the top of vfs_subr.c, with sections like "Vnode reclamation mechanism", "Vnode life-cycle", etc and thus document our knowledge. Now, each time we re-read and re-discover the logic and potential corner cases. And, I believe, not all corner cases. Just thinking out load. :) -- Mindaugas