Previous change to vn_lock() was bogus. If we got EDEADLK, it was from

lockmgr(), and it already unlocked v_interlock.  So, just return in this case.
This commit is contained in:
mycroft 1999-03-31 18:30:13 +00:00
parent dccf2a15e4
commit 0622545249

View File

@ -1,4 +1,4 @@
/* $NetBSD: vfs_vnops.c,v 1.35 1999/03/30 00:16:44 wrstuden Exp $ */
/* $NetBSD: vfs_vnops.c,v 1.36 1999/03/31 18:30:13 mycroft Exp $ */
/*
* Copyright (c) 1982, 1986, 1989, 1993
@ -537,13 +537,10 @@ vn_lock(vp, flags)
int flags;
{
int error;
int have_interlock = 0;
do {
if ((flags & LK_INTERLOCK) == 0) {
if ((flags & LK_INTERLOCK) == 0)
simple_lock(&vp->v_interlock);
have_interlock++;
}
if (vp->v_flag & VXLOCK) {
vp->v_flag |= VXWANT;
simple_unlock(&vp->v_interlock);
@ -551,14 +548,9 @@ vn_lock(vp, flags)
error = ENOENT;
} else {
error = VOP_LOCK(vp, flags | LK_INTERLOCK);
if (error == 0)
if (error == 0 || error == EDEADLK)
return (error);
}
if (error == EDEADLK) {
if (have_interlock)
simple_unlock(&vp->v_interlock);
break;
}
flags &= ~LK_INTERLOCK;
} while (flags & LK_RETRY);
return (error);