From 716d3ae08f5971574b037d0cfc1f5a23af917811 Mon Sep 17 00:00:00 2001 From: wrstuden Date: Tue, 26 Jun 2001 15:51:06 +0000 Subject: [PATCH] In vcount(), when getting rid of unused aliases, don't vgone one which has VXLOCK set - it's already being vgoned, most likely by one of our callers. If we call vgone, we can end up sleeping against ourself with VXLOCK set - we'll start the race for root. Pointed out by Love on tech-kern. Analysis from Artur Grabowski via Love. Should resolve PR kern/13077 --- sys/kern/vfs_subr.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/sys/kern/vfs_subr.c b/sys/kern/vfs_subr.c index dd9700572a33..f8090ba15b1f 100644 --- a/sys/kern/vfs_subr.c +++ b/sys/kern/vfs_subr.c @@ -1,4 +1,4 @@ -/* $NetBSD: vfs_subr.c,v 1.150 2001/06/05 04:42:05 thorpej Exp $ */ +/* $NetBSD: vfs_subr.c,v 1.151 2001/06/26 15:51:06 wrstuden Exp $ */ /*- * Copyright (c) 1997, 1998 The NetBSD Foundation, Inc. @@ -1785,7 +1785,8 @@ loop: /* * Alias, but not in use, so flush it out. */ - if (vq->v_usecount == 0 && vq != vp) { + if (vq->v_usecount == 0 && vq != vp && + (vq->v_flag & VXLOCK) == 0) { simple_unlock(&spechash_slock); vgone(vq); goto loop;