Date: Wed, 13 Nov 1996 18:55:53 -0800 From: David Greenman <dg@root.com> To: Terry Lambert <terry@lambert.org> Cc: michaelh@cet.co.jp, ponds!rivers@dg-rtp.dg.com, Hackers@FreeBSD.org Subject: Re: Even more info on daily panics... Message-ID: <199611140255.SAA09566@root.com> In-Reply-To: Your message of "Wed, 13 Nov 1996 10:32:19 MST." <199611131732.KAA22431@phaeton.artisoft.com>
next in thread | previous in thread | raw e-mail | index | archive | help
>> I would also like to hear an explaination of how it is possible, after the >> patch to vrele to prevent it from going negative, for a vnode with a non-zero >> v_usecount can be on the freelist in the first place. > >Please check my previous mail... > >There is a race condition caused by the fact that the vnode reclamation >is "smeared" across the VFS/FS boundry layer. It is not obvious unless >you consider interfaces to represent access points for automatons >instead of simply functional abstractions of object complexity (ie: it >is an artifact of layering errors). Terry, the problem has nothing to do with functional abstractions, automatons, layering errors, execution contexts, interface boundries, race conditions, or little green men from Alpha Centauri. Vnodes on the free list are not allowed to have non-zero v_usecount's. Vnodes can not be used without first gaining a reference (v_usecount++). Vnodes are removed from the freelist when this happens. I noticed last night that there is a v_usecount++ in the vnode_pager that could cause the problem that David is reporting if an object allocation was attempted for a vnode without first gaining a reference to it. We've had bugs like this before, so it should come as no surprise. David, please apply the attached patch and see if your system trips over it. Thanks. -DG David Greenman Core-team/Principal Architect, The FreeBSD Project Index: vnode_pager.c =================================================================== RCS file: /home/ncvs/src/sys/vm/vnode_pager.c,v retrieving revision 1.65 diff -c -r1.65 vnode_pager.c *** vnode_pager.c 1996/10/17 02:49:35 1.65 --- vnode_pager.c 1996/11/13 05:56:50 *************** *** 148,153 **** --- 148,155 ---- else object->flags = 0; + if (vp->v_usecount == 0) + panic("vnode_pager_alloc: no vnode reference"); /* * Hold a reference to the vnode and initialize object data. */
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?199611140255.SAA09566>