Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 05 Apr 1997 00:22:09 +0200
From:      Tor Egge <Tor.Egge@idi.ntnu.no>
To:        dfr@nlsystems.com
Cc:        dg@root.com, ponds!rivers@dg-rtp.dg.com, freebsd-hackers@FreeBSD.ORG
Subject:   Re: kern/3184: vnodes are used after they are freed. (dup alloc?)
Message-ID:  <199704042222.AAA14484@pat.idt.unit.no>
In-Reply-To: Your message of "Fri, 4 Apr 1997 17:43:38 %2B0100 (BST)"
References:  <Pine.BSF.3.95q.970404173819.8538D-100000@herring.nlsystems.com>

next in thread | previous in thread | raw e-mail | index | archive | help


> On Fri, 4 Apr 1997, Tor Egge wrote:
> 
> > When the vnode is on the freelist, with 0 as v_usecount, and the
> > vp->v_interlock is not locked, how should getnewvnode decide that the
> > vnode is not reusable ?  VOP_ISLOCKED ? Not currently used in
> > getnewvnode nor in vget.
> 
> The vnode in question is being recycled from VT_NFS to VT_UFS.
> Getnewvnode picks a vnode of the free list and calls vgone to extract it
> from the previous owner.  This calls VOP_LOCK(.., LK_DRAIN, ..) which is
> intended to block until the vnode is inactive.
> 
> For vnodes which are not being recycled but just picked up from the cache,
> there is no race but still either vget or its caller will lock the vnode
> before using it for anything important.


OK. I thought that vnode_free_list was meant to be a free list, due to
the list name. I was wrong.

Proper locking on NFS will help against the crash I experienced, but
if the NFS server goes down at the wrong moment, a call to getnewvnode
may hang until the NFS server is back again.

- Tor Egge



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199704042222.AAA14484>