From owner-freebsd-hackers Fri Apr 4 14:22:44 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id OAA07404 for hackers-outgoing; Fri, 4 Apr 1997 14:22:44 -0800 (PST) Received: from pat.idt.unit.no (0@pat.idt.unit.no [129.241.103.5]) by freefall.freebsd.org (8.8.5/8.8.5) with ESMTP id OAA07394 for ; Fri, 4 Apr 1997 14:22:34 -0800 (PST) Received: from idt.unit.no (26850@kamelia.idt.unit.no [129.241.111.27]) by pat.idt.unit.no (8.8.5/8.8.5) with ESMTP id AAA14484; Sat, 5 Apr 1997 00:22:12 +0200 (MET DST) Message-Id: <199704042222.AAA14484@pat.idt.unit.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?) In-Reply-To: Your message of "Fri, 4 Apr 1997 17:43:38 +0100 (BST)" References: X-Mailer: Mew version 1.06 on Emacs 19.34.1 Mime-Version: 1.0 Content-Type: Text/Plain; charset=us-ascii Date: Sat, 05 Apr 1997 00:22:09 +0200 From: Tor Egge Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > 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