summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorbp <bp@FreeBSD.org>2001-03-26 03:10:07 +0000
committerbp <bp@FreeBSD.org>2001-03-26 03:10:07 +0000
commit9aefd18cc80a8f27657aa1a59f80c55939d91408 (patch)
tree9599424e462c65428eeee939df284273a453152d
parenta9337488a53e9397967f1bba9c80d6464670350c (diff)
downloadFreeBSD-src-9aefd18cc80a8f27657aa1a59f80c55939d91408.zip
FreeBSD-src-9aefd18cc80a8f27657aa1a59f80c55939d91408.tar.gz
Prevent race condition by using msleep() instead of mtx_unlock()/tsleep().
Reviewed by: alfred
-rw-r--r--sys/kern/vfs_vnops.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/sys/kern/vfs_vnops.c b/sys/kern/vfs_vnops.c
index e60328d..bf33d16 100644
--- a/sys/kern/vfs_vnops.c
+++ b/sys/kern/vfs_vnops.c
@@ -625,8 +625,7 @@ debug_vn_lock(vp, flags, p, filename, line)
mtx_lock(&vp->v_interlock);
if ((vp->v_flag & VXLOCK) && vp->v_vxproc != curproc) {
vp->v_flag |= VXWANT;
- mtx_unlock(&vp->v_interlock);
- tsleep((caddr_t)vp, PINOD, "vn_lock", 0);
+ msleep(vp, &vp->v_interlock, PINOD, "vn_lock", 0);
error = ENOENT;
} else {
if (vp->v_vxproc != NULL)
OpenPOWER on IntegriCloud