summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorkato <kato@FreeBSD.org>1998-01-18 08:17:48 +0000
committerkato <kato@FreeBSD.org>1998-01-18 08:17:48 +0000
commita76ade94a20ed8dc3e746f0463b887c9758e2b0c (patch)
treefb99ed4ecd6b4ab4b9ae0550cf33acf35b16a4fd
parent5ff1564039736f2a608d963c03de2883d9430745 (diff)
downloadFreeBSD-src-a76ade94a20ed8dc3e746f0463b887c9758e2b0c.zip
FreeBSD-src-a76ade94a20ed8dc3e746f0463b887c9758e2b0c.tar.gz
Workarround for locking violation while recycling vnode which union fs
used in freelist.
-rw-r--r--sys/fs/unionfs/union_vnops.c18
-rw-r--r--sys/miscfs/union/union_vnops.c18
2 files changed, 28 insertions, 8 deletions
diff --git a/sys/fs/unionfs/union_vnops.c b/sys/fs/unionfs/union_vnops.c
index 434b6a0..1c6b124 100644
--- a/sys/fs/unionfs/union_vnops.c
+++ b/sys/fs/unionfs/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) {
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) {
OpenPOWER on IntegriCloud