From owner-freebsd-current@FreeBSD.ORG Sat Oct 10 22:04:22 2009 Return-Path: Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 6448C1065695 for ; Sat, 10 Oct 2009 22:04:22 +0000 (UTC) (envelope-from dimitry@andric.com) Received: from tensor.andric.com (cl-327.ede-01.nl.sixxs.net [IPv6:2001:7b8:2ff:146::2]) by mx1.freebsd.org (Postfix) with ESMTP id 2AA2E8FC1F for ; Sat, 10 Oct 2009 22:04:22 +0000 (UTC) Received: from [IPv6:2001:7b8:3a7:0:5595:f502:d368:640e] (unknown [IPv6:2001:7b8:3a7:0:5595:f502:d368:640e]) (using TLSv1 with cipher DHE-RSA-CAMELLIA256-SHA (256/256 bits)) (No client certificate requested) by tensor.andric.com (Postfix) with ESMTPSA id 631E35C43; Sun, 11 Oct 2009 00:04:20 +0200 (CEST) Message-ID: <4AD104E4.2070009@andric.com> Date: Sun, 11 Oct 2009 00:04:20 +0200 From: Dimitry Andric User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.2; en-US; rv:1.9.1.4pre) Gecko/20091003 Shredder/3.0pre MIME-Version: 1.0 To: Harald Schmalzbauer References: <4AD0BAFB.6020207@omnilan.de> <20091010175115.GC2259@deviant.kiev.zoral.com.ua> <4AD0EB24.5020700@omnilan.de> In-Reply-To: <4AD0EB24.5020700@omnilan.de> Content-Type: text/plain; charset=ISO-8859-15 Content-Transfer-Encoding: 7bit Cc: Kostik Belousov , freebsd-current@freebsd.org Subject: Re: shutdown not working with uart console X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2009 22:04:22 -0000 On 2009-10-10 22:14, Harald Schmalzbauer wrote: >> I wondering whether I was too conservative in r195509. >> Please try this. >> >> diff --git a/sys/kern/kern_exit.c b/sys/kern/kern_exit.c >> index 39b48e0..b96cdbf 100644 >> --- a/sys/kern/kern_exit.c >> +++ b/sys/kern/kern_exit.c >> @@ -340,10 +340,10 @@ exit1(struct thread *td, int rv) >> >> if (ttyvp != NULL) { >> sx_xunlock(&proctree_lock); >> - vn_lock(ttyvp, LK_EXCLUSIVE | LK_RETRY); >> - if (ttyvp->v_type != VBAD) >> + if (vn_lock(ttyvp, LK_EXCLUSIVE) == 0) { >> VOP_REVOKE(ttyvp, REVOKEALL); >> - VOP_UNLOCK(ttyvp, 0); >> + VOP_UNLOCK(ttyvp, 0); >> + } >> sx_xlock(&proctree_lock); >> } >> } > > Great, thanks a lot, this fixes my problem :) I had seen this issue too, some time ago, but disregarded it as just some anomaly. In any case, the above patch also fixes it for me.