diff options
author | jeff <jeff@FreeBSD.org> | 2006-02-22 06:17:31 +0000 |
---|---|---|
committer | jeff <jeff@FreeBSD.org> | 2006-02-22 06:17:31 +0000 |
commit | d08a9e33bf08ff93d6851c4cf4dff5ba27154688 (patch) | |
tree | 636282f25eda2b339217020519536fbc210aaf84 /sys/fs/nullfs | |
parent | 79ca2be05cf1a1b1dee266ef4bf5cbd75045936e (diff) | |
download | FreeBSD-src-d08a9e33bf08ff93d6851c4cf4dff5ba27154688.zip FreeBSD-src-d08a9e33bf08ff93d6851c4cf4dff5ba27154688.tar.gz |
- spell VOP_LOCK(vp, LK_RELEASE... VOP_UNLOCK(vp,... so that asserts in
vop_lock_post do not trigger.
- Rearrange null_inactive to null_hashrem earlier so there is no chance
of finding the null node on the hash list after the locks have been
switched.
- We should never have a NULL lowervp in null_reclaim() so there is
no need to handle this situation. panic instead.
MFC After: 1 week
Diffstat (limited to 'sys/fs/nullfs')
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index 8515c7e..6cb2279 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -567,7 +567,7 @@ null_lock(struct vop_lock_args *ap) panic("Unsupported lock request %d\n", ap->a_flags); } - VOP_LOCK(lvp, LK_RELEASE, td); + VOP_UNLOCK(lvp, 0, td); error = vop_stdlock(ap); } vdrop(lvp); @@ -652,23 +652,23 @@ null_reclaim(struct vop_reclaim_args *ap) struct vnode *lowervp = xp->null_lowervp; struct lock *vnlock; + if (lowervp) + null_hashrem(xp); /* * Use the interlock to protect the clearing of v_data to * prevent faults in null_lock(). */ VI_LOCK(vp); vp->v_data = NULL; + vp->v_object = NULL; vnlock = vp->v_vnlock; vp->v_vnlock = &vp->v_lock; - lockmgr(vp->v_vnlock, LK_EXCLUSIVE|LK_INTERLOCK, VI_MTX(vp), curthread); - if (lowervp) - null_hashrem(xp); - - vp->v_object = NULL; if (lowervp) { + lockmgr(vp->v_vnlock, + LK_EXCLUSIVE|LK_INTERLOCK, VI_MTX(vp), curthread); vput(lowervp); } else - lockmgr(vnlock, LK_RELEASE, NULL, curthread); + panic("null_reclaim: reclaiming an node with now lowervp"); FREE(xp, M_NULLFSNODE); return (0); @@ -678,6 +678,7 @@ static int null_print(struct vop_print_args *ap) { struct vnode *vp = ap->a_vp; + printf("\tvp=%p, lowervp=%p\n", vp, NULLVPTOLOWERVP(vp)); return (0); } |