From owner-freebsd-hackers Fri Apr 4 08:27:57 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id IAA17515 for hackers-outgoing; Fri, 4 Apr 1997 08:27:57 -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 IAA17508 for ; Fri, 4 Apr 1997 08:27:53 -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 SAA07632; Fri, 4 Apr 1997 18:27:20 +0200 (MET DST) Message-Id: <199704041627.SAA07632@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 16:43:08 +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: Fri, 04 Apr 1997 18:27:18 +0200 From: Tor Egge Sender: owner-hackers@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk > I tried testing your fix this morning and the 0xdeadb stuff just caused > vget to fault a couple of minutes into my test (simultaneous rm -rf > largetree and cvs co src, both remote). A different part of the Lite/2 commit removed an explicit check for the 0xdeadb stuff in vget. Perhaps the kludge is still needed there. > > This problem really has little to do with nfs_inactive. What is > happening is a race between vgone and vget which would normally be solved > by the vnode locks. Since NFS doesn't have vnode locks, the race > happens. In my opinion, the problem has to do with marking objects as free and reusable while they are still in use. 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. > I am most of the way there in implementing the right solution for NFS > which is to used shared locks for NFS; vgone can then use the lock > manager to wait for all the shared locks to drain before recycling the > vnode. Good. - Tor Egge