From 78ea15ef7f97a6e9f36765e4ddb00d0b5ba897ac Mon Sep 17 00:00:00 2001 From: bouyer Date: Thu, 31 Mar 2005 18:02:16 +0000 Subject: [PATCH] Don't eventually leak vnx and bp on unconfigure, pointed out by YAMAMOTO Takashi. Instead, let the current I/O complete before killing the thread. --- sys/dev/vnd.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/sys/dev/vnd.c b/sys/dev/vnd.c index 83e93c913c5d..337217198d99 100644 --- a/sys/dev/vnd.c +++ b/sys/dev/vnd.c @@ -1,4 +1,4 @@ -/* $NetBSD: vnd.c,v 1.113 2005/03/31 11:28:53 yamt Exp $ */ +/* $NetBSD: vnd.c,v 1.114 2005/03/31 18:02:16 bouyer Exp $ */ /*- * Copyright (c) 1996, 1997, 1998 The NetBSD Foundation, Inc. @@ -133,7 +133,7 @@ */ #include -__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.113 2005/03/31 11:28:53 yamt Exp $"); +__KERNEL_RCSID(0, "$NetBSD: vnd.c,v 1.114 2005/03/31 18:02:16 bouyer Exp $"); #if defined(_KERNEL_OPT) #include "fs_nfs.h" @@ -592,8 +592,6 @@ vndthread(void *arg) s = splbio(); while (vnd->sc_active >= vnd->sc_maxactive) { tsleep(&vnd->sc_tab, PRIBIO, "vndac", 0); - if (vnd->sc_flags & VNF_VUNCONF) - goto kthread_end; } vnd->sc_active++; nbp = VND_GETBUF(vnd); @@ -663,10 +661,8 @@ out: /* Arrive here at splbio */ done: biodone(bp); s = splbio(); - continue; } -kthread_end: vnd->sc_flags &= (~VNF_KTHREAD | VNF_VUNCONF); wakeup(&vnd->sc_kthread); splx(s);