diff options
author | kib <kib@FreeBSD.org> | 2009-05-31 14:52:45 +0000 |
---|---|---|
committer | kib <kib@FreeBSD.org> | 2009-05-31 14:52:45 +0000 |
commit | d52fd86523b726aba4b8411ebc8a3aae736ca352 (patch) | |
tree | 34b8c956e98e415223030df5cd11a454297d24c2 /sys/fs | |
parent | 30a553aba0f6a9438f00034d84aa2bd511e56d5c (diff) | |
download | FreeBSD-src-d52fd86523b726aba4b8411ebc8a3aae736ca352.zip FreeBSD-src-d52fd86523b726aba4b8411ebc8a3aae736ca352.tar.gz |
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
Diffstat (limited to 'sys/fs')
-rw-r--r-- | sys/fs/nullfs/null_vnops.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/fs/nullfs/null_vnops.c b/sys/fs/nullfs/null_vnops.c index fd421e4..e04b4d1 100644 --- a/sys/fs/nullfs/null_vnops.c +++ b/sys/fs/nullfs/null_vnops.c @@ -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); |