Subject: Re: reboot problems unmounting root
To: Andrew Doran <ad@netbsd.org>
From: Antti Kantee <pooka@cs.hut.fi>
List: tech-userlevel
Date: 07/05/2007 12:13:38
On Thu Jul 05 2007 at 10:07:20 +0100, Andrew Doran wrote:
> > + simple_lock(&vp->v_interlock);
> > + vxlock = vp->v_flag & VXLOCK;
> > + simple_unlock(&vp->v_interlock);
> > +
> > /*
> > * ..., but don't cache the device node. Also, if we did a
> > - * remove, don't cache the node.
> > + * remove, don't cache the node. Finally, if the node is
> > + * already being nuked, don't do this, as we would re-enter
> > + * the same path and deadlock.
> > */
> > - if (vp->v_type == VBLK || vp->v_type == VCHR
> > + if ((vp->v_type == VBLK || vp->v_type == VCHR
> > || (VTOLAYER(vp)->layer_flags & LAYERFS_REMOVED))
> > + && (vxlock == 0))
> > vgone(vp);
> > return (0);
> > }
>
> I think it's better to hold the interlock across the if statement and do
> a vgonel() instead.
Good call. O coffee, coffee, wherefore art thou, coffee?
--
Antti Kantee <pooka@iki.fi> Of course he runs NetBSD
http://www.iki.fi/pooka/ http://www.NetBSD.org/
"la qualité la plus indispensable du cuisinier est l'exactitude"