diff options
author | kato <kato@FreeBSD.org> | 1998-01-18 08:17:48 +0000 |
---|---|---|
committer | kato <kato@FreeBSD.org> | 1998-01-18 08:17:48 +0000 |
commit | a76ade94a20ed8dc3e746f0463b887c9758e2b0c (patch) | |
tree | fb99ed4ecd6b4ab4b9ae0550cf33acf35b16a4fd /sys/miscfs/union/union_vnops.c | |
parent | 5ff1564039736f2a608d963c03de2883d9430745 (diff) | |
download | FreeBSD-src-a76ade94a20ed8dc3e746f0463b887c9758e2b0c.zip FreeBSD-src-a76ade94a20ed8dc3e746f0463b887c9758e2b0c.tar.gz |
Workarround for locking violation while recycling vnode which union fs
used in freelist.
Diffstat (limited to 'sys/miscfs/union/union_vnops.c')
-rw-r--r-- | sys/miscfs/union/union_vnops.c | 18 |
1 files changed, 14 insertions, 4 deletions
diff --git a/sys/miscfs/union/union_vnops.c b/sys/miscfs/union/union_vnops.c index 434b6a0..1c6b124 100644 --- a/sys/miscfs/union/union_vnops.c +++ b/sys/miscfs/union/union_vnops.c @@ -35,7 +35,7 @@ * SUCH DAMAGE. * * @(#)union_vnops.c 8.32 (Berkeley) 6/23/95 - * $Id: union_vnops.c,v 1.46 1997/10/26 20:55:26 phk Exp $ + * $Id: union_vnops.c,v 1.47 1998/01/18 07:56:41 kato Exp $ */ #include <sys/param.h> @@ -1611,9 +1611,19 @@ union_unlock(ap) un->un_flags &= ~UN_LOCKED; - if ((un->un_flags & (UN_ULOCK|UN_KLOCK)) == UN_ULOCK) - VOP_UNLOCK(un->un_uppervp, 0, p); - + if ((un->un_flags & (UN_ULOCK|UN_KLOCK)) == UN_ULOCK) { + /* + * XXX + * Workarround for lockmgr violation. Need to implement + * real lockmgr-style lock/unlock. + */ + if ((ap->a_vp->v_flag & VDOOMED) && + ((struct lock *)un->un_uppervp->v_data)->lk_lockholder + == LK_KERNPROC) + VOP_UNLOCK(un->un_uppervp, 0, 0); + else + VOP_UNLOCK(un->un_uppervp, 0, p); + } un->un_flags &= ~UN_ULOCK; if (un->un_flags & UN_WANT) { |