From owner-freebsd-hackers Sat Apr 5 12:22:09 1997 Return-Path: Received: (from root@localhost) by freefall.freebsd.org (8.8.5/8.8.5) id MAA25607 for hackers-outgoing; Sat, 5 Apr 1997 12:22:09 -0800 (PST) Received: from phaeton.artisoft.com (phaeton.Artisoft.COM [198.17.250.50]) by freefall.freebsd.org (8.8.5/8.8.5) with SMTP id MAA25599 for ; Sat, 5 Apr 1997 12:22:05 -0800 (PST) Received: (from terry@localhost) by phaeton.artisoft.com (8.6.11/8.6.9) id NAA23438; Sat, 5 Apr 1997 13:03:20 -0700 From: Terry Lambert Message-Id: <199704052003.NAA23438@phaeton.artisoft.com> Subject: Re: kern/3184: vnodes are used after they are freed. (dup alloc?) To: Tor.Egge@idi.ntnu.no (Tor Egge) Date: Sat, 5 Apr 1997 13:03:20 -0700 (MST) Cc: dfr@nlsystems.com, terry@lambert.org, dg@root.com, ponds!rivers@dg-rtp.dg.com, freebsd-hackers@freebsd.org In-Reply-To: <199704051654.SAA01155@pat.idt.unit.no> from "Tor Egge" at Apr 5, 97 06:54:21 pm X-Mailer: ELM [version 2.4 PL24] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-hackers@freebsd.org X-Loop: FreeBSD.org Precedence: bulk > > I know about this problem. Unfortunately the only way of fixing it is > > probably to keep private pools of vnodes for each filesystem (which Terry > > has been badgering me about for *years*). It might happen but it is a > > fair amount of work. For the moment, I will settle with a system which is > > stable, even it does hang when a server fails. > > Two other ways: > > - Let getnewvnode call VOP_ISLOCKED and skip locked nodes on the > so-called free list. There's no holder, so it isn't locked. If it were locked via VOP_LOCK, then you wouldn'r be having this problem in the first place, since a VOP_LOCK will prevent a node from being vclean()'ed (that's the whole point of the NFS changes Doug has been trying to deal with, if you followed his postings on them). > - Delay putting vnodes onto the so-called free list until > VOP_INACTIVE has been called, and use a flag to indicate that a > vnode is not on the so-called free list even when v_usecount is > 0. Add needed checks where the code currently assumes that > v_usecount==0 means that the vnode is on the so-called free list. This is hard. It would much easier to go to a reference as a counting semaphore (vp->v_count++;) in all cases where the reference was held, and establish a "hold" on behalf of the recycler. Regards, Terry Lambert terry@lambert.org --- Any opinions in this posting are my own and not those of my present or previous employers.