Date: Sun, 31 May 2009 14:52:45 +0000 (UTC) From: Konstantin Belousov <kib@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r193172 - head/sys/fs/nullfs Message-ID: <200905311452.n4VEqjHf046695@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: kib Date: Sun May 31 14:52:45 2009 New Revision: 193172 URL: http://svn.freebsd.org/changeset/base/193172 Log: Lock the real null vnode lock before substitution of vp->v_vnlock. This should not really matter for correctness, since vp->v_lock is not locked before the call, and null_lock() holds the interlock, but makes the control flow for reclaim more clear. Tested by: pho Modified: head/sys/fs/nullfs/null_vnops.c Modified: head/sys/fs/nullfs/null_vnops.c ============================================================================== --- head/sys/fs/nullfs/null_vnops.c Sun May 31 14:48:51 2009 (r193171) +++ head/sys/fs/nullfs/null_vnops.c Sun May 31 14:52:45 2009 (r193172) @@ -683,14 +683,15 @@ null_reclaim(struct vop_reclaim_args *ap * Use the interlock to protect the clearing of v_data to * prevent faults in null_lock(). */ + lockmgr(&vp->v_lock, LK_EXCLUSIVE, NULL); VI_LOCK(vp); vp->v_data = NULL; vp->v_object = NULL; vp->v_vnlock = &vp->v_lock; - if (lowervp) { - lockmgr(vp->v_vnlock, LK_EXCLUSIVE | LK_INTERLOCK, VI_MTX(vp)); + VI_UNLOCK(vp); + if (lowervp) vput(lowervp); - } else + else panic("null_reclaim: reclaiming a node with no lowervp"); free(xp, M_NULLFSNODE);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200905311452.n4VEqjHf046695>