From owner-svn-src-head@FreeBSD.ORG Sat Oct 10 21:17:30 2009 Return-Path: Delivered-To: svn-src-head@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id B39361065670; Sat, 10 Oct 2009 21:17:30 +0000 (UTC) (envelope-from kib@FreeBSD.org) Received: from svn.freebsd.org (svn.freebsd.org [IPv6:2001:4f8:fff6::2c]) by mx1.freebsd.org (Postfix) with ESMTP id A2D228FC13; Sat, 10 Oct 2009 21:17:30 +0000 (UTC) Received: from svn.freebsd.org (localhost [127.0.0.1]) by svn.freebsd.org (8.14.3/8.14.3) with ESMTP id n9ALHUO5092619; Sat, 10 Oct 2009 21:17:30 GMT (envelope-from kib@svn.freebsd.org) Received: (from kib@localhost) by svn.freebsd.org (8.14.3/8.14.3/Submit) id n9ALHUKW092617; Sat, 10 Oct 2009 21:17:30 GMT (envelope-from kib@svn.freebsd.org) Message-Id: <200910102117.n9ALHUKW092617@svn.freebsd.org> From: Konstantin Belousov Date: Sat, 10 Oct 2009 21:17:30 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org X-SVN-Group: head MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Cc: Subject: svn commit: r197942 - head/sys/kern X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 10 Oct 2009 21:17:30 -0000 Author: kib Date: Sat Oct 10 21:17:30 2009 New Revision: 197942 URL: http://svn.freebsd.org/changeset/base/197942 Log: Refine r195509, instead of checking that vnode type is VBAD, that is set quite late in the revocation path, properly verify that vnode is not doomed before calling VOP. Reported and tested by: Harald Schmalzbauer MFC after: 3 days Modified: head/sys/kern/kern_exit.c Modified: head/sys/kern/kern_exit.c ============================================================================== --- head/sys/kern/kern_exit.c Sat Oct 10 21:10:49 2009 (r197941) +++ head/sys/kern/kern_exit.c Sat Oct 10 21:17:30 2009 (r197942) @@ -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); } }