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:
parent
dccf2a15e4
commit
0622545249
|
@ -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
|
* Copyright (c) 1982, 1986, 1989, 1993
|
||||||
|
@ -537,13 +537,10 @@ vn_lock(vp, flags)
|
||||||
int flags;
|
int flags;
|
||||||
{
|
{
|
||||||
int error;
|
int error;
|
||||||
int have_interlock = 0;
|
|
||||||
|
|
||||||
do {
|
do {
|
||||||
if ((flags & LK_INTERLOCK) == 0) {
|
if ((flags & LK_INTERLOCK) == 0)
|
||||||
simple_lock(&vp->v_interlock);
|
simple_lock(&vp->v_interlock);
|
||||||
have_interlock++;
|
|
||||||
}
|
|
||||||
if (vp->v_flag & VXLOCK) {
|
if (vp->v_flag & VXLOCK) {
|
||||||
vp->v_flag |= VXWANT;
|
vp->v_flag |= VXWANT;
|
||||||
simple_unlock(&vp->v_interlock);
|
simple_unlock(&vp->v_interlock);
|
||||||
|
@ -551,14 +548,9 @@ vn_lock(vp, flags)
|
||||||
error = ENOENT;
|
error = ENOENT;
|
||||||
} else {
|
} else {
|
||||||
error = VOP_LOCK(vp, flags | LK_INTERLOCK);
|
error = VOP_LOCK(vp, flags | LK_INTERLOCK);
|
||||||
if (error == 0)
|
if (error == 0 || error == EDEADLK)
|
||||||
return (error);
|
return (error);
|
||||||
}
|
}
|
||||||
if (error == EDEADLK) {
|
|
||||||
if (have_interlock)
|
|
||||||
simple_unlock(&vp->v_interlock);
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
flags &= ~LK_INTERLOCK;
|
flags &= ~LK_INTERLOCK;
|
||||||
} while (flags & LK_RETRY);
|
} while (flags & LK_RETRY);
|
||||||
return (error);
|
return (error);
|
||||||
|
|
Loading…
Reference in New Issue